public function __get($field) { $this->_operations[] = function ($input) use($field) { return Objects::getValue($input, $field); }; return $this; }
/** * @test */ public function shouldReturnValueFormArray() { //given $array = array('id' => 123, 'name' => 'John'); //when $value = Objects::getValue($array, 'name'); //then $this->assertEquals('John', $value); }
public static function extractField($name, $accessPrivate = false) { return function ($object) use($name, $accessPrivate) { return Objects::getValue($object, $name, null, $accessPrivate); }; }