You are here

public function ArrayObject::__set in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-stdlib/src/ArrayObject.php \Zend\Stdlib\ArrayObject::__set()

Sets the value at the specified key to value

Parameters

mixed $key:

mixed $value:

Return value

void

1 call to ArrayObject::__set()
ArrayObject::unserialize in vendor/zendframework/zend-stdlib/src/ArrayObject.php
Unserialize an ArrayObject

File

vendor/zendframework/zend-stdlib/src/ArrayObject.php, line 95

Class

ArrayObject
Custom framework ArrayObject implementation

Namespace

Zend\Stdlib

Code

public function __set($key, $value) {
  if ($this->flag == self::ARRAY_AS_PROPS) {
    return $this
      ->offsetSet($key, $value);
  }
  if (in_array($key, $this->protectedProperties)) {
    throw new Exception\InvalidArgumentException('$key is a protected property, use a different key');
  }
  $this->{$key} = $value;
}