Collection::get PHP Method

get() public method

public get ( $key, $default = null )
    public function get($key, $default = null)
    {
        if (isset($this->data[$key])) {
            return $this->data[$key];
        } else {
            $lowerkeys = array_change_key_case($this->data, CASE_LOWER);
            if (isset($lowerkeys[strtolower($key)])) {
                return $lowerkeys[$key];
            } else {
                return $default;
            }
        }
    }

Usage Example

 /**
  * @test Collection::get()
  */
 public function testGet()
 {
     $this->buildEnvironment();
     $result = $this->collection->get('a1');
     $expect = $this->source['a1'];
     $this->assertEquals($expect, $result);
 }
All Usage Examples Of Collection::get