当前属性是否等于某值

@param $attribute
@param null $value

@return static
542166
public function whereEquals($attribute, $value)
    {
        $this->data->must()->term($attribute, $value);

        return $this;
    }
416951
public function set($attribute, $value)
    {
        if (!$this->isImplemented($attribute)) {
            throw new Exception("PDO parameter not implemented - {$attribute}");
        }

        if ($this->hasValidator($attribute)) {
            $validator = $this->getValidator($attribute);
            $value = $this->{$validator}($value);
        }

        $this->attributes[$attribute] = $value;

        return $this;
    }
1373607
public function setAttribute($attribute, $value)
    {
        switch ($attribute) {
            case 'isSlowOnly':
                // Set whether the connection must only log slow queries.
                // The slow threshold must be set on the profiler (100ms by default).
                $this->isSlowOnly = $value;
                break;
            default:
                parent::setAttribute($attribute, $value);
        }
    }
789382
public function findBy($attribute, $value, $attributes = ['*'])
    {
        return $this->executeCallback(get_called_class(), __FUNCTION__, func_get_args(), function () use ($attribute, $value, $attributes) {
            return $this->prepareQuery($this->createModel())->where($attribute, '=', $value)->first($attributes);
        });
    }
754253
protected function castAttribute($attribute, $value)
    {
        if (array_key_exists($attribute, $this->filterCustomCasts())) {
            $customCastObject = $this->getCustomCastObject($attribute);

            return $customCastObject->castAttribute($value);
        }

        return parent::castAttribute($attribute, $value);
    }
1092078
public static function create($attribute, $value)
    {
        $attributesType = self::getAllAttributeType();
        foreach ($attributesType as $attributeType) {
            if ($attributeType->isMember($attribute)) {
                return $attributeType->create($value);
            }
        }

        return $value;
    }
13403
public function set($attribute, $value)
    {
        if ($value === [] || $value === '' || $value === null) {
            return $this->reset($attribute);
        }

        if ($this->has($attribute)) {
            $attribute = $this->resolveAttributeName($attribute);
            $this->attributes[$attribute] = $value;
        } else {
            $this->attributes[$attribute] = $value;
        }
        $this->batches->add(new Batch(Batch::TYPE['REPLACE'], $attribute, $value));

        return $this;
    }
564947
public function attr($name, $value = null)
    {
        if ($value === null) {
            return $this->getAttribute($name);
        }

        return $this->setAttribute($name, $value);
    }
1011604
protected function checkNullForAttribute($value, $attribute): bool
    {
        // We don't use $attribute here, we want filter all value with the same behavior
        if ($value === null) {
            return true;
        }

        if (is_array($value) === true && $value === []) {
            return true;
        }

        if ($value instanceof \Countable && count($value) === 0) {
            return true;
        }

        return false;
    }
415528
public function setNewValue($attribute, $value)
    {
        $this->assertValidAttribute($attribute);

        $this->documentChangeSet[$attribute][1] = $value;
        $this->getDocumentManager()->getUnitOfWork()->setDocumentChangeSet($this->getDocument(), $this->documentChangeSet);
    }
798834
public function setAttribute($attribute, $value) {
		if (!array_key_exists($attribute, $this->_readonlyAttributes)) {
			$this->_attributes[$attribute] = $value;
			return true;
		}

		return false;
	}
1364796
public function attribute($attr, $value = '')
    {
        if (is_array($attr)) {
            foreach ($attr as $key => $value) {
                $this->attribute($key, $value);
            }
        } else {
            $this->attributes[$attr] = $value;
        }

        return $this;
    }
1124316
public function setAttr($attr, $value) {
		$this->_attrs[$attr] = trim($value);
		$this->_tagCached    = null;
		
		return $this;
	}
283657
final protected function change($key, $value, array $attribute = null)
    {
        $attribute = $attribute ?: static::getMapper()->getAttribute($key);
        $type = Type::factory($attribute['type']);

        if (array_key_exists($key, $this->values)) {
            if ($value === $this->values[$key]) {
                return;
            } elseif ($type->isNull($value) && $type->isNull($this->values[$key])) {
                return;
            }
        } elseif ($type->isNull($value) && $attribute['allow_null']) {
            return;
        }

        $this->values[$key] = $value;
        $this->dirty[$key] = true;
    }
662597
public function cell($value, array $attributes = null)
        {
            $cell = new self;
            $cell->setValue($value);

            if (null !== $attributes) {
                $cell->setAttributes($attributes);
            }

            return $cell;
        }
311489
public function setAttribute($attr, $value)
    {

        $attr = strtolower($attr);

        if(is_null($value)) {
            unset($this->attributes[$attr]);
        }
        else {
            $this->attributes[$attr] = $value;
        }

        return $this;

    }
846743
public function setAttribute($attribute, $value = null)
    {
        if ($attribute === 'class') {
            $this->addClass($value);

            return $this;
        }

        $this->attributes[$attribute] = $value;

        return $this;
    }