mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 20:13:28 +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)
|
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->collectionVO = $collection;
|
||||||
$this->reference = $reference;
|
$this->reference = $reference;
|
||||||
|
|
||||||
|
$this->fetchInternalServices($app);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -314,9 +311,7 @@ class collection implements ThumbnailedElement, cache_cacheableInterface
|
|||||||
|
|
||||||
public function hydrate(Application $app)
|
public function hydrate(Application $app)
|
||||||
{
|
{
|
||||||
$this->app = $app;
|
$this->fetchInternalServices($app);
|
||||||
$this->databox = $app->getApplicationBox()->get_databox($this->reference->getDataboxId());
|
|
||||||
$this->collectionService = $app->getApplicationBox()->getCollectionService();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __sleep()
|
public function __sleep()
|
||||||
@@ -810,4 +805,15 @@ class collection implements ThumbnailedElement, cache_cacheableInterface
|
|||||||
{
|
{
|
||||||
$this->databox->delete_data_from_cache($this->get_cache_key($option));
|
$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