public function get($key, $value = null)
    {
        if ($key == $this->discrim && array_key_exists($value, $this->items)) {
            return $this->items[$value];
        }

        foreach ($this->items as $item) {
            if (is_array($item)) {
                if ($item[$key] == $value) {
                    return $item;
                }
            } elseif (is_object($item)) {
                if ($item->{$key} == $value) {
                    return $item;
                }
            }
        }
    }
public function get($key, $value = null)
    {
        if ($key == $this->discrim && array_key_exists($value, $this->items)) {
            return $this->items[$value];
        }

        foreach ($this->items as $item) {
            if (is_array($item)) {
                if ($item[$key] == $value) {
                    return $item;
                }
            } elseif (is_object($item)) {
                if ($item->{$key} == $value) {
                    return $item;
                }
            }
        }
    }
public function get ( $ key , $ value = null ) { if ( $ key == $ this -> discrim && array_key_exists ( $ value , $ this -> items ) ) { return $ this -> items [ $ value ] ; } foreach ( $ this -> items as $ item ) { if ( is_array ( $ item ) ) { if ( $ item [ $ key ] == $ value ) { return $ item ; } } elseif ( is_object ( $ item ) ) { if ( $ item -> { $ key } == $ value ) { return $ item ; } } } }
Get an item from the collection with a key and value.

@param mixed $key   The key to match with the value.
@param mixed $value The value to match with the key.

@return mixed The value or null.
Get an item from the collection with a key and value .