# |
Apr 19th 2017, 13:02 |
crazycoder |
https://api.cakephp.org/3.4/class-Cake.Datasource.EntityTrait.html#_setHidden |
# |
Apr 19th 2017, 13:01 |
crazycoder |
inoas, wait ... does cake will call that method automatically? |
# |
Apr 19th 2017, 13:00 |
inoas |
if it doesn't work you can always create that method in your entity |
# |
Apr 19th 2017, 13:00 |
inoas |
try $entity->setHidden( |
# |
Apr 19th 2017, 13:00 |
inoas |
well if that works, there you go |
# |
Apr 19th 2017, 13:00 |
crazycoder |
inoas, can i do it on the fly? i mean i would like to hide it only during a json call |
# |
Apr 19th 2017, 13:00 |
crazycoder |
in protected $_hidden = ['_joinData'] |
# |
Apr 19th 2017, 12:59 |
crazycoder |
inoas, yes |
# |
Apr 19th 2017, 12:57 |
inoas |
back to work |
# |
Apr 19th 2017, 12:57 |
inoas |
and you are hiding? _joinData? |
# |
Apr 19th 2017, 12:57 |
crazycoder |
Sector.php |
# |
Apr 19th 2017, 12:57 |
crazycoder |
no |
# |
Apr 19th 2017, 12:56 |
inoas |
maybe |
# |
Apr 19th 2017, 12:56 |
inoas |
in AgentsSector.php |
# |
Apr 19th 2017, 12:56 |
crazycoder |
inoas, however $_hidden works well! |
# |
Apr 19th 2017, 12:56 |
inoas |
but I gotta really return to work now |
# |
Apr 19th 2017, 12:56 |
inoas |
https://gist.github.com/inoas/b57055d2c7400b270198204381c27e51 |
# |
Apr 19th 2017, 12:56 |
inoas |
crazycoder: |
# |
Apr 19th 2017, 12:53 |
crazycoder |
in contain() |
# |
Apr 19th 2017, 12:52 |
crazycoder |
that way |
# |
Apr 19th 2017, 12:52 |
crazycoder |
i should do AgentsSectors.Sectors |
# |
Apr 19th 2017, 12:52 |
crazycoder |
wait |
# |
Apr 19th 2017, 12:52 |
inoas |
just 1 file, 4 association defintions (1 per side, 2 in join table) and a slight change to the finder |
# |
Apr 19th 2017, 12:52 |
inoas |
your saving doesnt change |
# |
Apr 19th 2017, 12:52 |
inoas |
you database doens't change |
# |
Apr 19th 2017, 12:51 |
inoas |
then the above solution works |
# |
Apr 19th 2017, 12:51 |
inoas |
if you setup hasMany/belongsTo correctly |
# |
Apr 19th 2017, 12:51 |
crazycoder |
yes |
# |
Apr 19th 2017, 12:51 |
inoas |
but it is automatic behavior of belongsToMany |
# |
Apr 19th 2017, 12:51 |
inoas |
I don't know why it fetches the whole _joinData |
# |
Apr 19th 2017, 12:50 |
crazycoder |
i need the sector name |
# |
Apr 19th 2017, 12:50 |
crazycoder |
inoas, it does not really make sense to me....agents_sectors only has agent_id and sector_id |
# |
Apr 19th 2017, 12:45 |
Junior |
thanks! |
# |
Apr 19th 2017, 12:45 |
Junior |
i am as we speak in the aware trait |
# |
Apr 19th 2017, 12:45 |
inoas |
just for checking |
# |
Apr 19th 2017, 12:45 |
inoas |
then add debug calls to the muffin footprint vendor code |
# |
Apr 19th 2017, 12:44 |
Junior |
if exists |
# |
Apr 19th 2017, 12:44 |
inoas |
10-15mins? |
# |
Apr 19th 2017, 12:44 |
Junior |
i need to see somehow what data exists inside the footprint |
# |
Apr 19th 2017, 12:44 |
Junior |
yes... it would take time but if i don't have other option.. |
# |
Apr 19th 2017, 12:44 |
inoas |
whatever, you get what I mean, isolate the issue ;) |