Ejemplo n.º 1
0
    }
    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);
 }
Ejemplo n.º 3
0
 function remove($k)
 {
     parent::Remove($k);
     //Reorder over gap
     $this->data = array_values($this->data);
 }
Ejemplo n.º 4
0
 public function remove($key)
 {
     return parent::removeIndex($key);
 }
Ejemplo n.º 5
0
 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]))));
 }