public function getValue($object, FieldInterface $field)
    {
        try {
            switch (get_class($field)) {
                case 'Massive\Bundle\SearchBundle\Search\Metadata\Field\Property':
                    return $this->getPropertyValue($object, $field);
                case 'Massive\Bundle\SearchBundle\Search\Metadata\Field\Expression':
                    return $this->getExpressionValue($object, $field);
                case 'Massive\Bundle\SearchBundle\Search\Metadata\Field\Field':
                    return $this->getFieldValue($object, $field);
                case 'Massive\Bundle\SearchBundle\Search\Metadata\Field\Value':
                    return $field->getValue();
            }
        } catch (\Exception $e) {
            throw new \Exception(sprintf(
                'Error encountered when trying to determine value from object "%s"',
                get_class($object)
            ), null, $e);
        }

        throw new \RuntimeException(sprintf(
            'Unknown field type "%s" when trying to convert "%s" into a search document',
            get_class($field),
            get_class($object)
        ));
    }
public function getValue($object, FieldInterface $field)
    {
        try {
            switch (get_class($field)) {
                case 'Massive\Bundle\SearchBundle\Search\Metadata\Field\Property':
                    return $this->getPropertyValue($object, $field);
                case 'Massive\Bundle\SearchBundle\Search\Metadata\Field\Expression':
                    return $this->getExpressionValue($object, $field);
                case 'Massive\Bundle\SearchBundle\Search\Metadata\Field\Field':
                    return $this->getFieldValue($object, $field);
                case 'Massive\Bundle\SearchBundle\Search\Metadata\Field\Value':
                    return $field->getValue();
            }
        } catch (\Exception $e) {
            throw new \Exception(sprintf(
                'Error encountered when trying to determine value from object "%s"',
                get_class($object)
            ), null, $e);
        }

        throw new \RuntimeException(sprintf(
            'Unknown field type "%s" when trying to convert "%s" into a search document',
            get_class($field),
            get_class($object)
        ));
    }
public function getValue ( $ object , FieldInterface $ field ) { try { switch ( get_class ( $ field ) ) { case 'Massive\Bundle\SearchBundle\Search\Metadata\Field\Property' : return $ this -> getPropertyValue ( $ object , $ field ) ; case 'Massive\Bundle\SearchBundle\Search\Metadata\Field\Expression' : return $ this -> getExpressionValue ( $ object , $ field ) ; case 'Massive\Bundle\SearchBundle\Search\Metadata\Field\Field' : return $ this -> getFieldValue ( $ object , $ field ) ; case 'Massive\Bundle\SearchBundle\Search\Metadata\Field\Value' : return $ field -> getValue ( ) ; } } catch ( \ Exception $ e ) { throw new \ Exception ( sprintf ( 'Error encountered when trying to determine value from object "%s"' , get_class ( $ object ) ) , null , $ e ) ; } throw new \ RuntimeException ( sprintf ( 'Unknown field type "%s" when trying to convert "%s" into a search document' , get_class ( $ field ) , get_class ( $ object ) ) ) ; }
Evaluate the value from the given object and field.

@param mixed $object
@param FieldInterface $field
Evaluate the value from the given object and field .