/** * Attempt to create an instance via a factory * * @param string $canonicalName * @param string $requestedName * @return mixed * @throws \Zend\ServiceManager\Exception\ServiceNotCreatedException If factory is not callable */ protected function createFromFactory($canonicalName, $requestedName) { $factory = $this->factories[$canonicalName]; if (is_string($factory) && class_exists($factory, true)) { $factory = new $factory($this->creationOptions); $this->factories[$canonicalName] = $factory; } return parent::createFromFactory($canonicalName, $requestedName); }