forked from cakephp/upgrade
-
Notifications
You must be signed in to change notification settings - Fork 5
5.x upgrade snippets
Mark Scherer edited this page Sep 22, 2023
·
13 revisions
CakePHP 5
-public function beforeFind(EventInterface $event, Query $query, ArrayObject $options, bool $primary): void {
+public function beforeFind(EventInterface $event, \Cake\ORM\Select\SelectQuery $query, ArrayObject $options, bool $primary): void {in model/behavior for all kind of event hooks
-public function findList(Query $query, array $options): Query {
+public function findList(\Cake\ORM\Select\SelectQuery $query, array $options): \Cake\ORM\Select\SelectQuery {-protected function _initializeSchema(TableSchemaInterface $schema): TableSchemaInterface {
+public function getSchema(): TableSchemaInterface {- protected $middlewareEnabled = false;
+ protected bool $middlewareEnabled = false;etc in Plugin
-Cake\Routing\Exception\RedirectException;
+Cake\Http\Exception\RedirectException;-protected $fixtures = [
+protected array $fixtures = [etc
-TableRegistry::clear();
+$this->getTableLocator()->clear();-protected $order = [
+protected array $order = [inside Table classes