Add selected fields and properties to parameters

@param array $fields
@param array $props
331764
public function addParamsSelected($fields = null, $props = null)
    {
        if (is_array($fields) && !empty($fields))
        {
            $this->arParams['SELECT_FIELDS'] = array_merge($this->arParams['SELECT_FIELDS'], $fields);
        }

        if (is_array($props) && !empty($props))
        {
            $this->arParams['SELECT_PROPS'] = array_merge($this->arParams['SELECT_PROPS'], $props);
        }
    }
1328816
public function setFields(array $fields)
    {
        foreach ($fields as $name => $value) {
            $this->setField($name, $value);
        }

        $this->prepareQuery();

        return $this;
    }
579321
public function setProps($props = array())
    {
        $props = $this->moveShortcuts($props);
        $type = isset($props['attribs']['type']) ? $props['attribs']['type'] : null;
        $typeChanging = $type && (!isset($this->attribs['type']) || $type !== $this->attribs['type']);
        $propsType = $typeChanging && isset($this->defaultPropsType[$type])
            ? $this->defaultPropsType[$type]
            : array();
        $this->props = $this->mergeProps(array(
            $this->props,
            $propsType,
            $props,
        ));
        if (empty($this->props['attribs']['x-moz-errormessage']) && !empty($this->props['invalidReason'])) {
            $this->props['attribs']['x-moz-errormessage'] = $this->props['invalidReason'];
        }
        $this->attribs = &$this->props['attribs'];
        $this->getId();
        if (\in_array($type, array('checkbox','radio','select'))) {
            $this->normalizeCrs();
        } elseif ($type == 'submit' && empty($props['label']) && !empty($props['attribs']['value'])) {
            $props['label'] = $props['attribs']['value'];
        }
    }
1098839
public function delFieldsArray(array $fields)
	{
	        foreach ($fields as $field) {
                        $this->_redis->hdel($this->_key, $field);
                }
	}
1270678
public function setFields($fields)
    {
        $this->fields = $fields; 
        $this->raw_fields = array_merge($this->raw_fields, $fields);   
        parent::setFields($fields);  
		return $this;
    }
1024287
public function setFields($fields = [])
    {
        $existingSchema = $this->get();

        $request = [];
        foreach ($fields as $field) {
            $mode = $this->hasField($field['name'], $existingSchema) ? 'replace-field' : 'add-field';
            $request[$mode][] = $field;
        }

        return $this->request($request);
    }
957074
protected function addValuesToFields(array $fields)
    {
        foreach ($fields as $name => &$field) {
            if (!empty($field['fields'])) {
                $field['fields'] = $this->addValuesToFields($field['fields']);
            } elseif ($field['type'] === 'checkbox') {
                // Value is a list of checked options.
                $value = array();
                foreach ($field['options'] as $optionName => $optionLabel) {
                    if ($this->getFormValue($optionName)) {
                        $value[] = $optionName;
                    }
                }
                $field['value'] = $value;
            } elseif (!isset($field['value'])) {
                // Explicitly set values (in the 'value' key) take precedence
                // over submitted values, which in turn take precedence over
                // default values (gathered via getDefaultFormValues()).
                $field['value'] = $this->getFormValue($name);
            }
        }
        return $fields;
    }
733454
public function setFields($fields)
    {
        if (\is_array($fields)) {
            $fields = \implode(',', $fields);
        }

        return $this->setParam('fields', (string) $fields);
    }
1270232
protected function fields(array $fields) {
        if (!empty($fields)) {
            if (!is_numeric(key($fields))) {
                $fields = array_keys($fields);
            }
            $this->insertFields = $fields;
        }
        return $this;
    }
915269
private function prepareFields(array $fields)
    {
        $preparedFields = [];

        foreach ($fields as $field) {
            $preparedFields[$field->getName()] = $field;
        }

        return $preparedFields;
    }
954177
public function select($fields = [])
    {
        if (is_array($fields)) {
            foreach ($fields as $field) {
                $this->addSelect($field);
            }
        } elseif (is_string($fields)) {
            $this->addSelect($fields);
        }

        return $this;
    }
592066
public function fields(array $fields = null) {
        if ($fields === null) {
            return $this->fields;
        }

        $this->fields = $fields;

        return $this;
    }
1188232
public function select($fields)
    {
        if (!is_array($fields)) {
            $fields = func_get_args();
        }

        $fields = $this->addTablePrefix($fields);
        $this->addStatement('selects', $fields);
        return $this;
    }
1249626
protected function initialize(array $fields)
    {
        $this->content = new Content;
        $this->revision = new Revision;

        foreach ($fields as $field => $settings) {
            $this->data[$field] = $this->initializeField($field, $settings);
        }
    }
950139
protected function addFields($fields)
    {
        $fields_array = [];
        foreach ($fields as $field => $value) {
            $fields_array[] = $field;
        }

        return '`' . implode('`, `', $fields_array) . '`';
    }
923372
private function addJoinsForProperties( array &$joins, array $properties )
    {
        foreach ( $properties as $property )
        {
            $joins['paragraph_property_' . $property] = array(
                'table'     => array(
                    'paragraph_property_' . $property => 'paragraph_property'
                ),
                'where'     => new TypedParameters(
                    '?.? = ?.? AND ?.? = ?',
                    array(
                        'paragraph',
                        'id',
                        'paragraph_property_' . $property,
                        'paragraphId',
                        'paragraph_property_' . $property,
                        'name',
                        $property,
                    ),
                    array(
                        TypedParameters::TYPE_IDENTIFIER,
                        TypedParameters::TYPE_IDENTIFIER,
                        TypedParameters::TYPE_IDENTIFIER,
                        TypedParameters::TYPE_IDENTIFIER,
                        TypedParameters::TYPE_IDENTIFIER,
                        TypedParameters::TYPE_IDENTIFIER,
                        TypedParameters::TYPE_VALUE,
                    )
                ),
                'columns'   => array( $property => 'value' ),
                'type'      => Select::JOIN_LEFT,
            );
        }
    }
823083
public function addFields(array $fields)
    {
        array_walk(
            $fields,
            function ($field, $key) {
                $this->addField($key, $field);
            }
        );
    }