单条记录

@param string $value
@param string $field
@param string $name
334004
public function get($value, $field = '*', $name = 'id')
    {
        $map = array(
            $name => $value
        );
        return $this->where($map)
            ->field($field)
            ->find();
    }
248300
public function setField($field,$value='') {
        if(is_array($field)) {
            $data           =   $field;
        }else{
            $data[$field]   =   $value;
        }
        return $this->save($data);
    }
789349
public void setValue(String fieldName, String value) {
    int index = getFieldIndex(fieldName);
    assert(index != -1);
    values[index] = value;
  }
98970
@JsonAnySetter
    public void setOthers(String name, Object value) {
        if(name.startsWith("_")) {
            // Just be defensive
            throw new RuntimeException("This is a reserved field, and should not be treated as document content.");
        }
        this.others.put(name, value);
    }
590008
protected function setParam($name, $value) {
        $params = $this->getParams();
        $params->$name = $value;
        $this->setParams($params);
    }
1126389
function setParameter($name, $value)
    {
        $this->field = $name;
        $this->descending = boolval($value);
        return $this;
    }
520607
protected function hasRule(string $name, string $field): bool
    {
        foreach ($this->_validations as $validation) {
            if ($validation['rule'] === $name && \in_array($field, $validation['fields'], true)) {
                return true;
            }
        }

        return false;
    }
972932
public function withFieldAnnotation($fieldName, $name, $value)
    {
        $copy = clone $this;

        $copy->annotations = $this->annotations->update(
            $fieldName,
            function (ArrayMap $fieldAnnotations) use ($name, $value) {
                return $fieldAnnotations->insert($name, $value);
            },
            ArrayMap::zero()
        );

        return $copy;
    }
980844
public function setMeta($id, $name, $value, $field = 'value') {
        if (is_array($value)) {
            $value = json_encode($value, JSON_UNESCAPED_UNICODE);
        }

        return $this->updateMeta($id, $name, $field, $value);
    }
1241136
public function text($name = null, $value = null) 
	{
		Argument::i()
			->test(1, 'string', 'null')
			->test(2, 'scalar', 'null');
			
		$field = Text::i();
		
		if(!is_null($name)) {
			$field->setName($name);
		}
		
		if(!is_null($value)) {
			$field->setValue($value);
		}
		
		return $field;
	}
116280
public function setFieldError($field, $name)
    {
        if (!$this->app->compat_42) {
            throw $this->exception('4.3', '_Obsolete');
        }
        $this->errors[$field] = (isset($this->errors[$field]) ? $this->errors[$field] : '').$name;
    }
170336
public function setFieldValue($fieldName, $value)
    {
        if ($this->hasField($fieldName) == false) {
            throw new SolrMappingException(sprintf('Field %s does not exist', $fieldName));
        }

        $field = $this->getField($fieldName);
        $field->value = $value;
    }
880034
public function createHiddenField($name = '', $value = '')
    {
        if ($name == '') {
            $this->errorMessage[] = 'HTML HIDDEN: field name is empty';
            return false;
        }
        $inputId = $name;
        if (substr($name, -2, 2) == "[]") {
            $inputId = substr($name, 0, -2);
        }
        return "\n<input type='hidden' name='" . $name . "' id='" . $inputId . "' value='" . $value . "' />";
    }
819200
public function button($value, $name = null) 
	{
		Argument::i()
			->test(1, 'string')
			->test(2, 'string', 'null')
			->test(3, 'bool');
		
		$field = Button::i()->setValue($value);
		
		if(!is_null($name)) {
			$field->setName($name);
		}
		
		return $field;
	}
383883
public function tag($name = null, $value = null) 
	{
		Argument::i()
			->test(1, 'string', 'null')
			->test(2, 'scalar', 'null');
			
		$field = Tag::i();
		
		if(!is_null($name)) {
			$field->setName($name);
		}
		
		if(!is_null($value)) {
			$field->setValue($value);
		}
		
		return $field;
	}
1293408
private function SetInternally($name, $value)
    {
        $schema = $this->GetSchema();
        $mapper = $schema->FieldMapper($name);
        $this->fieldValues[$name] = $mapper->MapValue($value);
    }
968984
private function setAccessed($accessor, string $name, $value)
    {
        if (array_key_exists($name, $this->fields)) {
            $field = $this->fields[$name];
        } else {
            $field = null;
        }

        if (empty($field) || !($field instanceof AccessorInterface)) {
            //New field representation
            $field = $this->createAccessor($accessor, $name, $value);

            //Save accessor with other fields
            $this->fields[$name] = $field;
        }

        //Letting accessor to set value
        $field->setValue($value);
    }