/** * Builds the main repository, heart of eZ Publish API. * * This always returns the true inner Repository, please depend on ezpublish.api.repository and not this method * directly to make sure you get an instance wrapped inside Signal / Cache / * functionality. * * @param \eZ\Publish\SPI\Persistence\Handler $persistenceHandler * @param \eZ\Publish\SPI\Search\Handler $searchHandler * * @return \eZ\Publish\API\Repository\Repository */ public function buildRepository(PersistenceHandler $persistenceHandler, SearchHandler $searchHandler) { $config = $this->container->get('ezpublish.api.repository_configuration_provider')->getRepositoryConfig(); $repository = new $this->repositoryClass($persistenceHandler, $searchHandler, array('fieldType' => $this->fieldTypeCollectionFactory->getFieldTypes(), 'nameableFieldTypes' => $this->fieldTypeNameableCollectionFactory->getNameableFieldTypes(), 'role' => array('limitationTypes' => $this->roleLimitations, 'policyMap' => $this->policyMap), 'languages' => $this->configResolver->getParameter('languages'), 'content' => ['default_version_archive_limit' => $config['options']['default_version_archive_limit']]), new UserReference($this->configResolver->getParameter('anonymous_user_id'))); return $repository; }
/** * Builds the main repository, heart of eZ Publish API. * * This always returns the true inner Repository, please depend on ezpublish.api.repository and not this method * directly to make sure you get an instance wrapped inside Signal / Cache / * functionality. * * @param \eZ\Publish\SPI\Persistence\Handler $persistenceHandler * @param \eZ\Publish\SPI\Search\Handler $searchHandler * * @return \eZ\Publish\API\Repository\Repository */ public function buildRepository(PersistenceHandler $persistenceHandler, SearchHandler $searchHandler) { $repository = new $this->repositoryClass($persistenceHandler, $searchHandler, array('fieldType' => $this->fieldTypeCollectionFactory->getFieldTypes(), 'nameableFieldTypes' => $this->fieldTypeNameableCollectionFactory->getNameableFieldTypes(), 'role' => array('limitationTypes' => $this->roleLimitations), 'languages' => $this->container->getParameter('languages')), new UserReference($this->container->getParameter('anonymous_user_id'))); return $repository; }