public function getInstanceValueForFields(Model $modelInstance, $fields)
    {
        $values = [];
        /** @var $field Field */
        foreach ($fields as $field) {
            $val = $modelInstance->{$field->getAttrName()};
            if (!$val) {
                continue;
            }
            $values[] = $val;
        }

        return $values;
    }
public function getInstanceValueForFields(Model $modelInstance, $fields)
    {
        $values = [];
        /** @var $field Field */
        foreach ($fields as $field) {
            $val = $modelInstance->{$field->getAttrName()};
            if (!$val) {
                continue;
            }
            $values[] = $val;
        }

        return $values;
    }
public function getInstanceValueForFields ( Model $ modelInstance , $ fields ) { $ values = [ ] ; /** @var $field Field */ foreach ( $ fields as $ field ) { $ val = $ modelInstance -> { $ field -> getAttrName ( ) } ; if ( ! $ val ) { continue ; } $ values [ ] = $ val ; } return $ values ; }
Returns the value of fields provided from the model instance.

@author: Eddilbert Macharia (http://eddmash.com)<edd.cowan@gmail.com>

@param Model $modelInstance
@param array $fields

@return array
Returns the value of fields provided from the model instance .