protected function getFieldsFromDataArray(array $fieldsArray)
    {
        $fields = array();
        foreach ($fieldsArray as $fieldArray) {
            $field = new Field();

            if (isset($fieldArray['name']) && is_string($fieldArray['name'])) {
                $field->setName($fieldArray['name']);
            }

            if (isset($fieldArray['type']) && is_string($fieldArray['type'])) {
                $field->setType($fieldArray['type']);
            }

            if (isset($fieldArray['value'])) {
                $field->setValue($fieldArray['value']);
            }

            $fields[] = $field;
        }

        return $fields;
    }
protected function getFieldsFromDataArray(array $fieldsArray)
    {
        $fields = array();
        foreach ($fieldsArray as $fieldArray) {
            $field = new Field();

            if (isset($fieldArray['name']) && is_string($fieldArray['name'])) {
                $field->setName($fieldArray['name']);
            }

            if (isset($fieldArray['type']) && is_string($fieldArray['type'])) {
                $field->setType($fieldArray['type']);
            }

            if (isset($fieldArray['value'])) {
                $field->setValue($fieldArray['value']);
            }

            $fields[] = $field;
        }

        return $fields;
    }
protected function getFieldsFromDataArray ( array $ fieldsArray ) { $ fields = array ( ) ; foreach ( $ fieldsArray as $ fieldArray ) { $ field = new Field ( ) ; if ( isset ( $ fieldArray [ 'name' ] ) && is_string ( $ fieldArray [ 'name' ] ) ) { $ field -> setName ( $ fieldArray [ 'name' ] ) ; } if ( isset ( $ fieldArray [ 'type' ] ) && is_string ( $ fieldArray [ 'type' ] ) ) { $ field -> setType ( $ fieldArray [ 'type' ] ) ; } if ( isset ( $ fieldArray [ 'value' ] ) ) { $ field -> setValue ( $ fieldArray [ 'value' ] ) ; } $ fields [ ] = $ field ; } return $ fields ; }
Helper method to convert a fields data array to an array of field objects

@param array $fieldsArray
@return Field[]
Helper method to convert a fields data array to an array of field objects