public function getWriteConnection($model) { if ($this->getDI()->getDbMaster()) { $this->setWriteConnectionService($model, 'dbMaster'); } return parent::getWriteConnection($model); }