Exemplo n.º 1
0
 /**
  * Construct an array object from a string of comma separated items
  *
  * @param string $input a string of comma separated items
  */
 function __construct($input)
 {
     if (is_string($input)) {
         $input = strlen($input) ? array_map('trim', explode(',', $input)) : array();
     }
     parent::__construct((array) $input);
 }
Exemplo n.º 2
0
 /**
  * Unsets the value at the specified index
  * value is moved to internal deleted collection
  *
  * @see ArrayObject::offsetUnset()
  * @throws InvalidArgumentException
  */
 function offsetUnset($index)
 {
     if ($this->offsetExists($index)) {
         $this->deleted[] = $this->offsetGet($index);
     }
     return parent::offsetUnset($index);
 }
Exemplo n.º 3
0
 /**
  * Constructor
  *
  * @param array  $input
  * @param int    $flags
  * @param string $iteratorClass
  */
 public function __construct($input = array(), $flags = self::STD_PROP_LIST, $iteratorClass = 'ArrayIterator')
 {
     parent::__construct(array(), $flags, $iteratorClass);
     $this->exchangeArray($input);
 }