} public function offsetSet($key, $value) { $this->_keys[spl_object_hash($key)] = $key; $this->_values[spl_object_hash($key)] = $value; } public function offsetGet($key) { return $this->_values[spl_object_hash($key)]; } public function offsetExists($key) { return array_key_exists(spl_object_hash($key), $this->_values); } public function offsetUnset($key) { unset($this->_values[spl_object_hash($key)]); unset($this->_keys[spl_object_hash($key)]); } public function getKey($hash) { return $this->_keys[$hash]; } } $key = new KeyObject(); $collection = new CollectionObject(); $collection[$key] = 'test'; foreach ($collection as $k => $v) { print_r($collection->getKey($k)); print_r($v); }
protected function _Set($k, $v) { parent::_Set($k, $v); usort($this->data, $this->function); }
function remove($k) { parent::Remove($k); //Reorder over gap $this->data = array_values($this->data); }
public function remove($key) { return parent::removeIndex($key); }
public function __construct() { $args = func_get_args(); $data = Ensure::Input($args[0]); parent::__construct($data, new AppendsResource(array(array("term" => "recordingId", "link" => TRUE, "value" => $args[1])))); }