1 | <?php |
||
19 | class IndexPopulateEvent extends IndexEvent |
||
20 | { |
||
21 | /** |
||
22 | * @Event("FOS\ElasticaBundle\Event\IndexPopulateEvent") |
||
23 | */ |
||
24 | const PRE_INDEX_POPULATE = 'elastica.index.index_pre_populate'; |
||
25 | |||
26 | /** |
||
27 | * @Event("FOS\ElasticaBundle\Event\IndexPopulateEvent") |
||
28 | */ |
||
29 | const POST_INDEX_POPULATE = 'elastica.index.index_post_populate'; |
||
30 | |||
31 | /** |
||
32 | * @var bool |
||
33 | */ |
||
34 | private $reset; |
||
35 | |||
36 | /** |
||
37 | * @var array |
||
38 | */ |
||
39 | private $options; |
||
40 | |||
41 | /** |
||
42 | * @param string $index |
||
43 | * @param boolean $reset |
||
44 | * @param array $options |
||
45 | */ |
||
46 | public function __construct($index, $reset, $options) |
||
47 | { |
||
48 | parent::__construct($index); |
||
49 | |||
50 | $this->reset = $reset; |
||
51 | $this->options = $options; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @return boolean |
||
56 | */ |
||
57 | public function isReset() |
||
58 | { |
||
59 | return $this->reset; |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return array |
||
64 | */ |
||
65 | public function getOptions() |
||
66 | { |
||
67 | return $this->options; |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * @param boolean $reset |
||
72 | */ |
||
73 | public function setReset($reset) |
||
77 | |||
78 | /** |
||
79 | * @param string $name |
||
80 | * |
||
81 | * @return mixed |
||
82 | * |
||
83 | * @throws \InvalidArgumentException if option does not exist |
||
84 | */ |
||
85 | public function getOption($name) |
||
93 | |||
94 | /** |
||
95 | * @param string $name |
||
96 | * @param mixed $value |
||
97 | */ |
||
98 | public function setOption($name, $value) |
||
102 | } |
||
103 |