diff --git a/src/Listener/ViewListener.php b/src/Listener/ViewListener.php index 229ab319..06a3c489 100644 --- a/src/Listener/ViewListener.php +++ b/src/Listener/ViewListener.php @@ -65,7 +65,7 @@ public function beforePaginate(Event $event) $this->associations = $this->_associations(array_keys($related)); } - if (!$event->getSubject()->query->contain()) { + if (!$event->getSubject()->query->getContain()) { $event->getSubject()->query->contain($this->_getRelatedModels(['manyToOne', 'oneToOne'])); } } @@ -211,7 +211,7 @@ protected function _getRelatedModels($associationTypes = []) foreach ($associationTypes as $assocType) { $associations = array_merge( $associations, - $this->_table()->associations()->type($assocType) + $this->_table()->associations()->getByType($assocType) ); } }