associations - cakephp3: How to call functions of related models in both directions -


i have 3 models, a, b, , c, where

  • a has 1 b
  • and a has many c.

if method a.update() called calls methods b.task() , c.task(), , contain, b , care available within a.

however if in b.sometask() method need call c.anothertask()?

if debug($this) in a, see entities b , c, if debug($this) in b or c see properties of entity.

should there not property in b (or c) references entity a well?

i know can adjust contain , add in a should contain b,c => [a], creates second sql query when should have a?

is there trickery missing here?


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -