Set which field's value will be used to key the records by

@param $field
504545
public function keyResultsBy($field)
    {
        $results = clone $this->results;
        $this->results = new Collection;
        foreach ($results as $r) {
            $this->addRecord($r, $field);
        }
    }
263051
protected function setFields()
    {
        $this->set = new \stdClass();
        $schema    = $this->schema();

        foreach ($schema as $field => $type)
        {
            if (Helpers\Validate::isNumeric($type) && $field != 'id')
            {
                $this->setField($field, 0);
            }
            else
            {
                $this->setField($field, null);
            }
        }
    }
1345357
public function setField($field, $value = '')
    {
        if (is_array($field)) {
            $data = $field;
        } else {
            $data[$field] = $value;
        }
        return $this->update($data);
    }
968148
public function order($field) {
        $order = [];
        if (is_array($field)) {
            foreach ($field as $key => $value) {
                $order[] = $key . ' ' . $value;
            }
        } else {
            $order = func_get_args();
        }
        $order = implode(',', $order);
        $this->order = !empty($order) ? ' ORDER BY ' . $order : '';
        return $this;
    }
514301
public function set(string $field, $value)
    {
        $this->update();
        $this->mongoDbUpdate['$set'][$field] = $value;

        return $this;
    }
452897
public function hset($key, $field, $value) {

        $set = $this->get($key, array());

        $set[$field] = $value;
        $this->set($key, $set);
    }
293773
public function addFetchFields($field) {
    if (!is_array($field)) {
      if (!in_array($field, $this->fetches)) {
        $this->fetches[] = $field;
      }
    } else {
      $this->fetches = $field;
    }
  }
76926
protected function setFields($fields) 
    {
    	foreach ($fields as $name => $value) {
            $property = '_' . $name;
            if (property_exists($this, $property)) $this->$property = $value;
        }
    }
288625
public function setSettingsValue($key, $value)
    {
        if ($this->isKeyAllowed($key)) {
            return;
        }

        $this->fieldValues[$key] = $value;
    }
1147130
public function keyBy(string $field)
    {
        return $this->bindNewInstance(Arr::group($this->dump(), $field));
    }
1268680
protected function setFieldValue( $field, $fieldPostName )
    {
        $http = eZHTTPTool::instance();
        if( $http->hasPostVariable( $fieldPostName ) )
        {
            $this->fieldValues[$field] = $http->postVariable( $fieldPostName );
        }
    }
603220
public function setFieldParam(string $field, string $key, string $value): self
    {
        if (!isset($this->_params[$field])) {
            $this->_params[$field] = [];
        }

        $this->_params[$field][$key] = $value;

        return $this;
    }
1123178
public function setField($field)
    {
        if(is_string($field)) {
            $field = new FieldIdentifier($field);
        }
        $this->field = $field;
        return $this;
    }
102138
function create_new_field_keys( &$field )
	{
		// update key
		$field['key'] = 'field_' . uniqid();
		
		
		if( isset($field['sub_fields']) && is_array($field['sub_fields']) )
		{
			foreach( $field['sub_fields'] as $f )
			{
				$this->create_new_field_keys( $f );
			}
		}
		elseif( isset($field['layouts']) && is_array($field['layouts']) )
		{
			foreach( $field['layouts'] as $layout )
			{
				if( isset($layout['sub_fields']) && is_array($layout['sub_fields']) )
				{
					foreach( $layout['sub_fields'] as $f )
					{
						$this->create_new_field_keys( $f );
					}
				}
				
			}
		}
	}
665896
protected function updateFormField($field)
    {
        parent::updateFormField($field);

        if ($this->MinValue) {
            $field->setAttribute('data-rule-min', $this->MinValue);
        }

        if ($this->MaxValue) {
            $field->setAttribute('data-rule-max', $this->MaxValue);
        }
    }
1330503
private static function setFields($fields) {
        $fieldsString = '';
        $i = 0;
        foreach($fields as $key => $val) {
            $fieldsString .= ($i > 0 ? ",\n  " : '') . self::$_ops->addBackticks($key) .
                             self::$_ops->operandi($val, true, true);
            $i++;
        }
        return $fieldsString;
    }
1076718
public function set($field, $value = null , $insert = true, $update = true)
    {

        if (is_array($field)) {
            foreach ($field as $key=>$val) {
                $this->set($key, $val, $insert, $update);
            }
        }

        $this->add($field, '', 'auto');
        if ($insert)
            $this->field($field)->insertValue($value);

        if ($update)
            $this->field($field)->updateValue($value);

    }