/** * 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); }
/** * Constructor * * @param mixed $data array or closure to fill collection */ function __construct($data = array()) { parent::__construct(); $this->finder = $data instanceof Closure ? $data : null; $this->deleted = clone $this; if ($data instanceof Closure) { $this->refresh(); } else { $this->exchangeArray($data); } }
/** * 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); }