mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Add de/serialization methods for collection caching
This commit is contained in:
@@ -236,6 +236,16 @@ EOT;
|
||||
return $collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* @var Application
|
||||
*/
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* @var databox
|
||||
*/
|
||||
protected $databox;
|
||||
|
||||
/**
|
||||
* @var CollectionReference
|
||||
*/
|
||||
@@ -261,21 +271,17 @@ EOT;
|
||||
*/
|
||||
protected $labels = [];
|
||||
|
||||
/**
|
||||
* @var databox
|
||||
*/
|
||||
protected $databox;
|
||||
|
||||
/**
|
||||
* @var int[]|string
|
||||
*/
|
||||
protected $binary_logo;
|
||||
|
||||
/**
|
||||
* @var Application
|
||||
* @param Application $app
|
||||
* @param $baseId
|
||||
* @param CollectionReference $reference
|
||||
* @param array $row
|
||||
*/
|
||||
protected $app;
|
||||
|
||||
public function __construct(Application $app, $baseId, CollectionReference $reference, array $row)
|
||||
{
|
||||
$this->app = $app;
|
||||
@@ -295,6 +301,24 @@ EOT;
|
||||
];
|
||||
}
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
return array(
|
||||
'reference',
|
||||
'name',
|
||||
'preferences',
|
||||
'pub_wm',
|
||||
'labels',
|
||||
'binary_logo'
|
||||
);
|
||||
}
|
||||
|
||||
public function hydrate(Application $app)
|
||||
{
|
||||
$this->app = $app;
|
||||
$this->databox = $app->getApplicationBox()->get_databox($this->reference->getDataboxId());
|
||||
}
|
||||
|
||||
private function dispatch($eventName, CollectionEvent $event)
|
||||
{
|
||||
$this->app['dispatcher']->dispatch($eventName, $event);
|
||||
|
Reference in New Issue
Block a user