/** * @param Event $event * @param ModelManagerInterface $modelsManager * @param ModelInterface $model */ public function afterInitialize(Event $event, ModelManagerInterface $modelsManager, ModelInterface $model) { $className = get_class($model); $className = str_replace("\\", "_", $className); $modelsManager->setModelSource($model, $className); }
/** * Sets table name which model should be mapped * * @param string $source * @return \Phalcon\Mvc\Model * @throws Exception */ protected function setSource($source) { if (is_string($source) === false) { throw new Exception('Invalid parameter type.'); } $this->_modelsManager->setModelSource($this, $source); return $this; }