| @@ 18-71 (lines=54) @@ | ||
| 15 | use FOS\ElasticaBundle\Provider\PagerInterface; |
|
| 16 | use Symfony\Contracts\EventDispatcher\Event; |
|
| 17 | ||
| 18 | final class PreFetchObjectsEvent extends Event implements PersistEvent |
|
| 19 | { |
|
| 20 | /** |
|
| 21 | * @var PagerInterface |
|
| 22 | */ |
|
| 23 | private $pager; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @var ObjectPersisterInterface |
|
| 27 | */ |
|
| 28 | private $objectPersister; |
|
| 29 | ||
| 30 | /** |
|
| 31 | * @var array |
|
| 32 | */ |
|
| 33 | private $options; |
|
| 34 | ||
| 35 | public function __construct(PagerInterface $pager, ObjectPersisterInterface $objectPersister, array $options) |
|
| 36 | { |
|
| 37 | $this->pager = $pager; |
|
| 38 | $this->objectPersister = $objectPersister; |
|
| 39 | $this->options = $options; |
|
| 40 | } |
|
| 41 | ||
| 42 | public function getPager(): PagerInterface |
|
| 43 | { |
|
| 44 | return $this->pager; |
|
| 45 | } |
|
| 46 | ||
| 47 | public function setPager(PagerInterface $pager) |
|
| 48 | { |
|
| 49 | $this->pager = $pager; |
|
| 50 | } |
|
| 51 | ||
| 52 | public function getOptions(): array |
|
| 53 | { |
|
| 54 | return $this->options; |
|
| 55 | } |
|
| 56 | ||
| 57 | public function setOptions(array $options) |
|
| 58 | { |
|
| 59 | $this->options = $options; |
|
| 60 | } |
|
| 61 | ||
| 62 | public function getObjectPersister(): ObjectPersisterInterface |
|
| 63 | { |
|
| 64 | return $this->objectPersister; |
|
| 65 | } |
|
| 66 | ||
| 67 | public function setObjectPersister(ObjectPersisterInterface $objectPersister) |
|
| 68 | { |
|
| 69 | $this->objectPersister = $objectPersister; |
|
| 70 | } |
|
| 71 | } |
|
| 72 | ||
| @@ 18-71 (lines=54) @@ | ||
| 15 | use FOS\ElasticaBundle\Provider\PagerInterface; |
|
| 16 | use Symfony\Contracts\EventDispatcher\Event; |
|
| 17 | ||
| 18 | final class PrePersistEvent extends Event implements PersistEvent |
|
| 19 | { |
|
| 20 | /** |
|
| 21 | * @var PagerInterface |
|
| 22 | */ |
|
| 23 | private $pager; |
|
| 24 | ||
| 25 | /** |
|
| 26 | * @var ObjectPersisterInterface |
|
| 27 | */ |
|
| 28 | private $objectPersister; |
|
| 29 | ||
| 30 | /** |
|
| 31 | * @var array |
|
| 32 | */ |
|
| 33 | private $options; |
|
| 34 | ||
| 35 | public function __construct(PagerInterface $pager, ObjectPersisterInterface $objectPersister, array $options) |
|
| 36 | { |
|
| 37 | $this->pager = $pager; |
|
| 38 | $this->objectPersister = $objectPersister; |
|
| 39 | $this->options = $options; |
|
| 40 | } |
|
| 41 | ||
| 42 | public function getPager(): PagerInterface |
|
| 43 | { |
|
| 44 | return $this->pager; |
|
| 45 | } |
|
| 46 | ||
| 47 | public function setPager(PagerInterface $pager) |
|
| 48 | { |
|
| 49 | $this->pager = $pager; |
|
| 50 | } |
|
| 51 | ||
| 52 | public function getOptions(): array |
|
| 53 | { |
|
| 54 | return $this->options; |
|
| 55 | } |
|
| 56 | ||
| 57 | public function setOptions(array $options) |
|
| 58 | { |
|
| 59 | $this->options = $options; |
|
| 60 | } |
|
| 61 | ||
| 62 | public function getObjectPersister(): ObjectPersisterInterface |
|
| 63 | { |
|
| 64 | return $this->objectPersister; |
|
| 65 | } |
|
| 66 | ||
| 67 | public function setObjectPersister(ObjectPersisterInterface $objectPersister) |
|
| 68 | { |
|
| 69 | $this->objectPersister = $objectPersister; |
|
| 70 | } |
|
| 71 | } |
|
| 72 | ||