Example #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);
 }
Example #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);
 }
 /**
  * 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);
 }