src/EntityProcessor/GetterSetterEntityProcessor.php
public function getFromEntity($entity, array $formParameters, $limitFields = null)
    {
        $extracted_data = array();

        foreach($formParameters as $field) {
            $getter_name = "get".$this->dashesToCamelCase($field);

            if (($limitFields === null || in_array($field, $limitFields)) && method_exists($entity, $getter_name) && ($value = $entity->$getter_name()) !== null) {
                $extracted_data[$field] = $value;
            }
        }

        return $extracted_data;
    }
public function getFromEntity($entity, array $formParameters, $limitFields = null)
    {
        $extracted_data = array();

        foreach($formParameters as $field) {
            $getter_name = "get".$this->dashesToCamelCase($field);

            if (($limitFields === null || in_array($field, $limitFields)) && method_exists($entity, $getter_name) && ($value = $entity->$getter_name()) !== null) {
                $extracted_data[$field] = $value;
            }
        }

        return $extracted_data;
    }
public function getFromEntity ( $ entity , array $ formParameters , $ limitFields = null ) { $ extracted_data = array ( ) ; foreach ( $ formParameters as $ field ) { $ getter_name = "get" . $ this -> dashesToCamelCase ( $ field ) ; if ( ( $ limitFields === null || in_array ( $ field , $ limitFields ) ) && method_exists ( $ entity , $ getter_name ) && ( $ value = $ entity -> $ getter_name ( ) ) !== null ) { $ extracted_data [ $ field ] = $ value ; } } return $ extracted_data ; }
Get data from an entity using getter methods

@param $entity
@param array $formParameters
@param null $limitFields
@return array
Get data from an entity using getter methods