/** * @param string $type * @return DoctrineRestServiceModel */ public function getModel($type = DoctrineRestServiceModelFactory::TYPE_DEFAULT) { if ($this->model instanceof DoctrineRestServiceModel) { return $this->model; } $moduleName = $this->getModuleName(); $this->model = $this->restFactory->factory($moduleName, $type); return $this->model; }