php - Extending ORM classes in CakePHP 3 -


i extend query class in order create function customcontain() available in every table model. how should it?

i want use blemethod() in table models in cakephp. have add code of function? have implements blemethod?

unlike cake2 cake3 not feature application level class appmodel other classes inherit from. have 2 options:

the behavior can loaded globally models using model.initialize event. , loading behavior inside events callback. read these pages:

but that's not want

customcontain() indicates me want setup contains often. well, use finders.

finders can combined:

$this->table->find('foo')->find('mycontains')->all(); 

each custom find add query object. can add custom contains way.

read custom finder methods.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -