diff --git a/lib/Model/Search/AttributeToUpdate.php b/lib/Model/Search/AttributeToUpdate.php index 9630ef7a..4fdaedf5 100644 --- a/lib/Model/Search/AttributeToUpdate.php +++ b/lib/Model/Search/AttributeToUpdate.php @@ -20,7 +20,7 @@ class AttributeToUpdate extends AbstractModel implements ModelInterface, \ArrayA */ protected static $modelTypes = [ 'operation' => '\Algolia\AlgoliaSearch\Model\Search\BuiltInOperationType', - 'value' => 'string', + 'value' => '\Algolia\AlgoliaSearch\Model\Search\BuiltInOperationValue', ]; /** @@ -194,7 +194,7 @@ public function setOperation($operation) /** * Gets value. * - * @return string + * @return BuiltInOperationValue */ public function getValue() { @@ -204,7 +204,7 @@ public function getValue() /** * Sets value. * - * @param string $value value that corresponds to the operation, for example an `Increment` or `Decrement` step, or an `Add` or `Remove` value + * @param BuiltInOperationValue $value value * * @return self */ diff --git a/lib/Model/Search/BuiltInOperation.php b/lib/Model/Search/BuiltInOperation.php index 99221bf8..ca4404af 100644 --- a/lib/Model/Search/BuiltInOperation.php +++ b/lib/Model/Search/BuiltInOperation.php @@ -22,7 +22,7 @@ class BuiltInOperation extends AbstractModel implements ModelInterface, \ArrayAc */ protected static $modelTypes = [ 'operation' => '\Algolia\AlgoliaSearch\Model\Search\BuiltInOperationType', - 'value' => 'string', + 'value' => '\Algolia\AlgoliaSearch\Model\Search\BuiltInOperationValue', ]; /** @@ -196,7 +196,7 @@ public function setOperation($operation) /** * Gets value. * - * @return string + * @return BuiltInOperationValue */ public function getValue() { @@ -206,7 +206,7 @@ public function getValue() /** * Sets value. * - * @param string $value value that corresponds to the operation, for example an `Increment` or `Decrement` step, or an `Add` or `Remove` value + * @param BuiltInOperationValue $value value * * @return self */ diff --git a/lib/Model/Search/BuiltInOperationValue.php b/lib/Model/Search/BuiltInOperationValue.php new file mode 100644 index 00000000..c2f0347a --- /dev/null +++ b/lib/Model/Search/BuiltInOperationValue.php @@ -0,0 +1,191 @@ +listInvalidProperties()); + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + * + * @return null|mixed + */ + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param null|int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } +}