diff --git a/src/Console/Command.php b/src/Console/Command.php index 9bc4f2658ce..9711b9ad61b 100644 --- a/src/Console/Command.php +++ b/src/Console/Command.php @@ -43,8 +43,10 @@ class Command */ public function __construct() { - $locator = $this->getTableLocator() ? : 'Cake\ORM\TableRegistry'; - $this->modelFactory('Table', [$locator, 'get']); + $locator = $this->getTableLocator(); + $this->modelFactory('Table', function($alias){ + return $this->getTableLocator()->get($alias); + }); } /**