Ejemplo n.º 1
0
 /**
  * @param \Phalcon\Mvc\ModelInterface $model
  * @return \Phalcon\Db\AdapterInterface
  */
 public function getWriteConnection($model)
 {
     if ($this->getDI()->offsetExists($model->getWriteConnectionService())) {
         $this->setWriteConnectionService($model, $model->getWriteConnectionService());
     } elseif ($this->getDI()->getDbMaster()) {
         $this->setWriteConnectionService($model, 'dbMaster');
     }
     return parent::getWriteConnection($model);
 }