/** * __get * * @param string $property * * @return mixed */ public function __get($property) { //check if property exists as a model if (array_key_exists($property, (array) $this->tables)) { return $this->serviceLocator->get(__NAMESPACE__ . '\\' . $this->tables[$property]); } //defaults to parent return parent::__get($property); }