mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 03:23:19 +00:00
Collection Hydration should fetch internal services.
This commit is contained in:
@@ -278,13 +278,10 @@ class collection implements ThumbnailedElement, cache_cacheableInterface
|
||||
*/
|
||||
public function __construct(Application $app, CollectionVO $collection, CollectionReference $reference)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->databox = $app->getApplicationBox()->get_databox($reference->getDataboxId());
|
||||
$this->collectionService = $app->getApplicationBox()->getCollectionService();
|
||||
$this->collectionRepositoryRegistry = $app['repo.collections-registry'];
|
||||
|
||||
$this->collectionVO = $collection;
|
||||
$this->reference = $reference;
|
||||
|
||||
$this->fetchInternalServices($app);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -314,9 +311,7 @@ class collection implements ThumbnailedElement, cache_cacheableInterface
|
||||
|
||||
public function hydrate(Application $app)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->databox = $app->getApplicationBox()->get_databox($this->reference->getDataboxId());
|
||||
$this->collectionService = $app->getApplicationBox()->getCollectionService();
|
||||
$this->fetchInternalServices($app);
|
||||
}
|
||||
|
||||
public function __sleep()
|
||||
@@ -810,4 +805,15 @@ class collection implements ThumbnailedElement, cache_cacheableInterface
|
||||
{
|
||||
$this->databox->delete_data_from_cache($this->get_cache_key($option));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Application $app
|
||||
*/
|
||||
private function fetchInternalServices(Application $app)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->databox = $app->getApplicationBox()->get_databox($this->reference->getDataboxId());
|
||||
$this->collectionService = $app->getApplicationBox()->getCollectionService();
|
||||
$this->collectionRepositoryRegistry = $app['repo.collections-registry'];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user