From 7cff195b1ca772065a669387f397a4501529f62e Mon Sep 17 00:00:00 2001 From: Anto Date: Fri, 5 Jan 2018 20:10:41 +0100 Subject: [PATCH] Remove deprecated function calls --- src/Console/CommandRunner.php | 4 ++-- src/ORM/Association/BelongsToMany.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Console/CommandRunner.php b/src/Console/CommandRunner.php index 776ad121794..2c3725abc1a 100644 --- a/src/Console/CommandRunner.php +++ b/src/Console/CommandRunner.php @@ -22,7 +22,7 @@ use Cake\Console\Exception\StopException; use Cake\Console\Shell; use Cake\Core\ConsoleApplicationInterface; -use Cake\Event\EventManagerTrait; +use Cake\Event\EventDispatcherTrait; use Cake\Utility\Inflector; use RuntimeException; @@ -31,7 +31,7 @@ */ class CommandRunner { - use EventManagerTrait; + use EventDispatcherTrait; /** * The application console commands are being run for. diff --git a/src/ORM/Association/BelongsToMany.php b/src/ORM/Association/BelongsToMany.php index fe35876694f..9887f4119f2 100644 --- a/src/ORM/Association/BelongsToMany.php +++ b/src/ORM/Association/BelongsToMany.php @@ -784,7 +784,7 @@ protected function _saveTarget(EntityInterface $parentEntity, $entities, $option // Saving the new linked entity failed, copy errors back into the // original entity if applicable and abort. if (!empty($options['atomic'])) { - $original[$k]->errors($entity->errors()); + $original[$k]->setErrors($entity->getErrors()); } if (!$saved) { return false;