public function getPropertyValue($entity, $field, $default = null)
    {
        $this->assertEntity($entity);

        if (is_array($entity) || $entity instanceof \ArrayAccess) {
            return isset($entity[$field]) ? $entity[$field] : $default;
        }

        $ref = $this->getReflection($entity);
        if (!$ref->hasProperty($field)) {
            return isset($entity->{$field}) ? $entity->{$field} : $default;
        }

        return $this->getProperty($ref, $field)->getValue($entity);
    }
public function getPropertyValue($entity, $field, $default = null)
    {
        $this->assertEntity($entity);

        if (is_array($entity) || $entity instanceof \ArrayAccess) {
            return isset($entity[$field]) ? $entity[$field] : $default;
        }

        $ref = $this->getReflection($entity);
        if (!$ref->hasProperty($field)) {
            return isset($entity->{$field}) ? $entity->{$field} : $default;
        }

        return $this->getProperty($ref, $field)->getValue($entity);
    }
public function getPropertyValue ( $ entity , $ field , $ default = null ) { $ this -> assertEntity ( $ entity ) ; if ( is_array ( $ entity ) || $ entity instanceof \ ArrayAccess ) { return isset ( $ entity [ $ field ] ) ? $ entity [ $ field ] : $ default ; } $ ref = $ this -> getReflection ( $ entity ) ; if ( ! $ ref -> hasProperty ( $ field ) ) { return isset ( $ entity -> { $ field } ) ? $ entity -> { $ field } : $ default ; } return $ this -> getProperty ( $ ref , $ field ) -> getValue ( $ entity ) ; }
Returns property value

@param array|object $entity
@param string       $field
@param mixed        $default

@return mixed
@throws AccessorException
Returns property value