Log message #4100679

# At Username Text
# Dec 4th 2017, 14:46 hmic d-fens: i think it is neccessary and the reason this is a trait and not behavior
# Dec 4th 2017, 14:45 d-fens undefined $count
# Dec 4th 2017, 14:44 d-fens ok, and the cleanupBelongsToMany Method can go ?
# Dec 4th 2017, 14:41 hmic it's a trait even, not a behavior. but you will get it... you add the trait to the table that has the countercache behavior attatched too, and just call it's method, telling it which caches to update, basically ;-)
# Dec 4th 2017, 14:41 d-fens *k
# Dec 4th 2017, 14:40 d-fens thans
# Dec 4th 2017, 14:38 hmic https://gist.github.com/hmic/f38b409bb483de8d5b85bec1e0334abe
# Dec 4th 2017, 14:38 hmic tried to remove the corresponding code bloat:
# Dec 4th 2017, 14:38 hmic i've used that from a shell and issued lots of events during the course to get logged back to the shell
# Dec 4th 2017, 14:32 d-fens found no revalidateCache() method or smth like that
# Dec 4th 2017, 14:31 d-fens would be really nice
# Dec 4th 2017, 14:31 hmic don't know if it still applies/works. but i can gist it if you like (it's ~ 3.1 ish time)
# Dec 4th 2017, 14:31 hmic i've once written a behavior to recalculate all cached values
# Dec 4th 2017, 14:30 hmic the cache will be updated as soon as anything realted to the cached value changes - so long your data will be wrong if you updae the database independently
# Dec 4th 2017, 14:29 hmic d-fens: you are not to do so
# Dec 4th 2017, 14:29 d-fens the cache is in place, db changed and this shoudl be picked up
# Dec 4th 2017, 14:29 saeideng If you don’t have a custom finder method you can provide an array of conditions to find records instead:
# Dec 4th 2017, 14:28 saeideng ``` $this->addBehavior('CounterCache', [ 'Articles' => [ 'comment_count' => [ 'conditions' => ['Comments.spam' => false] ] ] ]); ```
# Dec 4th 2017, 14:26 d-fens like don' t want to manually dummy edit a entity just to get the countercache recalculated
# Dec 4th 2017, 14:26 d-fens hi, how can i mass update the countercache value ?
# Dec 4th 2017, 14:12 admad great, thanks
# Dec 4th 2017, 14:12 wyrihaximus Sounds fixable. Let me finish migrating a site and then I'll have a look at it
# Dec 4th 2017, 14:11 admad so you if a bake theme doesn't have .twig template you always get back the .ctp from default bake theme
# Dec 4th 2017, 14:11 admad Because for themes if a template is not found then View looks for same file within app itself (or inside bake in case of bake) which is always found
# Dec 4th 2017, 14:10 admad @wyrihaximus the fallback to ctp if twig template is not available implemented in Twig::_getViewFilename() doesn't work as expected when using themes.
# Dec 4th 2017, 14:07 wyrihaximus @admad sup?
# Dec 4th 2017, 14:04 obinoob9 is there any built in option to validate one entity from a batch of hasManny associations? I have worked around by looping $this->request->data and unset the index...
# Dec 4th 2017, 13:59 admad @birdy247 @dereuromark it's a bug in how TwigView handles fallback to ctp if twig file is not found. I'll take it up with @wyrihaximus
# Dec 4th 2017, 13:42 birdy247 yes json type
# Dec 4th 2017, 13:33 hmic not as fields in the table, but a combined field, like JsonType, so you can add arbitrary things...
# Dec 4th 2017, 13:32 birdy247 etc.
# Dec 4th 2017, 13:32 birdy247 hmic we hold controller => xxxx. action => xxxx
# Dec 4th 2017, 13:32 hmic but that's only my 5ct
# Dec 4th 2017, 13:31 hmic birdy247: i'd rather use a tree structure, additionaly, i'd not want ready-build urls in the db, but the information needed to build them
# Dec 4th 2017, 13:28 max775 Ok ill keep that in mind and keep everything except communication out of the controllers ;)
# Dec 4th 2017, 13:28 birdy247 not ideal, but it works :slightly_smiling_face:
# Dec 4th 2017, 13:28 birdy247 in a text editor
# Dec 4th 2017, 13:28 birdy247 for now, the menu is created used dot noation (custom data type)
# Dec 4th 2017, 13:27 birdy247 its for a multitenant app
# Dec 4th 2017, 13:27 birdy247 we then store the cake url array as json
# Dec 4th 2017, 13:27 birdy247 s