CakePHP 3.8: Как написать волшебные @methods && @properity?
Мы запускаем phpstan @ cakephp 3.8 и получаем такие ошибки:
1: __call() https://api.cakephp.org/3.8/source-class-Cake.Database.FunctionsBuilder.html
238 Call to an undefined method Cake\Database\FunctionsBuilder::year().
239 Call to an undefined method Cake\Database\FunctionsBuilder::week().
2: волшебный метод поиска
46 Call to an undefined method App\Model\Table\HolidaysTable::findByDateAndState().
Изменить: эта работа
@method \Cake\ORM\Table\__call\Cake\ORM\Query findByDateAndState($var, $var)
3:
$locations = $this->Locations->find();
foreach ($locations as $location) {
//.. some code $location->address;
}
-
Access to an undefined property object::$address