diff options
Diffstat (limited to 'lib/Model/Index.php')
-rw-r--r-- | lib/Model/Index.php | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/lib/Model/Index.php b/lib/Model/Index.php index a390e6a..0c01171 100644 --- a/lib/Model/Index.php +++ b/lib/Model/Index.php @@ -51,6 +51,9 @@ class Index implements \JsonSerializable { private $documentId; /** @var string */ + private $source = ''; + + /** @var string */ private $ownerId = ''; /** @var int */ @@ -91,6 +94,25 @@ class Index implements \JsonSerializable { /** + * @param string $source + * + * @return $this + */ + public function setSource($source) { + $this->source = $source; + + return $this; + } + + /** + * @return string + */ + public function getSource() { + return $this->source; + } + + + /** * @param string $ownerId * * @return $this @@ -159,7 +181,7 @@ class Index implements \JsonSerializable { * * @return $this */ - public function setOption($option, $value) { + public function addOption($option, $value) { $this->options[$option] = $value; return $this; @@ -185,6 +207,21 @@ class Index implements \JsonSerializable { /** + * @param string $option + * @param string $default + * + * @return mixed|string + */ + public function getOption($option, $default = '') { + if (!array_key_exists($option, $this->options)) { + return $default; + } + + return $this->options[$option]; + } + + + /** * @param int $err * * @return $this |