cache[$cacheKey])) { return $this->cache[$cacheKey]; } $config = $this->serviceLocator->get('config'); // defined which class should be used for which table $tableGatewayMap = $config['table-gateway']['map']; if (isset($tableGatewayMap[$tableName])) { $className = $tableGatewayMap[$tableName]; $this->cache[$cacheKey] = new $className(); } else { $db = $this->serviceLocator->get('database'); $this->cache[$cacheKey] = new DbTableGateway($tableName, $db, $features, $resultSetPrototype); } return $this->cache[$cacheKey]; } /* (non-PHPdoc) * @see \Zend\ServiceManager\ServiceLocatorAwareInterface::setServiceLocator() */ public function setServiceLocator(ServiceLocatorInterface $serviceLocator) { $this->serviceLocator = $serviceLocator; } /* (non-PHPdoc) * @see \Zend\ServiceManager\ServiceLocatorAwareInterface::getServiceLocator() */ public function getServiceLocator() { $this->serviceLocator; } }