Sets HTML table attribute(s).

@param string|array $attribute
@param mixed $value
@return $this
508371
public function setTableAttribute($attribute, $value = null)
    {
        if (is_array($attribute)) {
            return $this->setTableAttributes($attribute);
        }

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

        return $this;
    }
102015
function set($attribute, $value = null) {
    $attributes = is_array($attribute)
                ? $attribute
                : [$attribute => $value];

    foreach ($attributes as $attr => $val) {

      if ($this->getPropertyFor($attr, 'accepts')) {
          $acceptsConstraint = new Attributes\Constraint\Accepts($this->getPropertyFor($attr, 'accepts'));
          if (!$acceptsConstraint->isValid($val)) {
              throw new InvalidArgumentException(__CLASS__ . " does not accept {$val} as value for the property {$attr}");
          }
      }

      if ($this->getPropertyFor($attr, 'minimum')) {
          $minimumConstraint = new Attributes\Constraint\Minimum($this->getPropertyFor($attr, 'minimum'));
          if (!$minimumConstraint->isValid($val)) {
              throw new InvalidArgumentException(__CLASS__ . " does not accept {$val} as value for the property {$attr}");
          }
      }

      if ($this->getPropertyFor($attr, 'maximum')) {
          $maximumConstraint = new Attributes\Constraint\Maximum($this->getPropertyFor($attr, 'maximum'));
          if (!$maximumConstraint->isValid($val)) {
              throw new InvalidArgumentException(__CLASS__ . " does not accept {$val} as value for the property {$attr}");
          }
      }

      $this->setPropertyFor($attr, 'value', $val, 'set');
    }

    return $this;
  }
291724
public function setAttribute($attribute, $value)
    {
        // Give mutator priority over custom casts
        if ($this->hasSetMutator($attribute)) {
            $method = 'set' . studly_case($attribute) . 'Attribute';

            return $this->{$method}($value);
        }

        if (array_key_exists($attribute, $this->filterCustomCasts())) {
            /** @var $customCastObject CustomCastBase */
            $customCastObject = $this->getCustomCastObject($attribute);

            $this->attributes[$attribute] = $customCastObject->setAttribute($value);

            return $this;
        }

        parent::setAttribute($attribute, $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;
    }
415528
public function setNewValue($attribute, $value)
    {
        $this->assertValidAttribute($attribute);

        $this->documentChangeSet[$attribute][1] = $value;
        $this->getDocumentManager()->getUnitOfWork()->setDocumentChangeSet($this->getDocument(), $this->documentChangeSet);
    }
1306626
public function setAttribute($attribute, $value)
    {
        switch($attribute){

            case Core::ATTR_AUTO_ACCESSOR_OVERRIDE:
            case Core::ATTR_AUTO_FREE_QUERY_OBJECTS:
            case Core::ATTR_AUTOCOMMIT:
            case Core::ATTR_AUTOLOAD_TABLE_CLASSES:
            case Core::ATTR_CACHE:
            case Core::ATTR_CACHE_LIFESPAN:
            case Core::ATTR_CASCADE_SAVES:
            case Core::ATTR_CASE:
            case Core::ATTR_CLIENT_VERSION:
            case Core::ATTR_CMPNAME_FORMAT:
            case Core::ATTR_COLL_KEY:
            case Core::ATTR_COLL_LIMIT:
            case Core::ATTR_COLLECTION_CLASS:
            case Core::ATTR_CONNECTION_STATUS:
            case Core::ATTR_CREATE_TABLES:
            case Core::ATTR_CURSOR:
            case Core::ATTR_CURSOR_NAME:
            case Core::ATTR_DBNAME_FORMAT:
            case Core::ATTR_DECIMAL_PLACES:
            case Core::ATTR_DEF_TABLESPACE:
            case Core::ATTR_DEF_TEXT_LENGTH:
            case Core::ATTR_DEF_VARCHAR_LENGTH:
            case Core::ATTR_DEFAULT_COLUMN_OPTIONS:
            case Core::ATTR_DEFAULT_IDENTIFIER_OPTIONS:
            case Core::ATTR_DEFAULT_PARAM_NAMESPACE:
            case Core::ATTR_DEFAULT_SEQUENCE:
            case Core::ATTR_DEFAULT_TABLE_CHARSET:
            case Core::ATTR_DEFAULT_TABLE_COLLATE:
            case Core::ATTR_DEFAULT_TABLE_TYPE:
            case Core::ATTR_DRIVER_NAME:
            case Core::ATTR_EMULATE_DATABASE:
            case Core::ATTR_ERRMODE:
            case Core::ATTR_EXPORT:
            case Core::ATTR_FETCH_CATALOG_NAMES:
            case Core::ATTR_FETCH_TABLE_NAMES:
            case Core::ATTR_FETCHMODE:
            case Core::ATTR_FIELD_CASE:
            case Core::ATTR_FKNAME_FORMAT:
            case Core::ATTR_HYDRATE_OVERWRITE:
            case Core::ATTR_IDXNAME_FORMAT:
            case Core::ATTR_LISTENER:
            case Core::ATTR_LOAD_REFERENCES:
            case Core::ATTR_MAX_COLUMN_LEN:
            case Core::ATTR_MAX_IDENTIFIER_LENGTH:
            case Core::ATTR_MODEL_CLASS_PREFIX:
            case Core::ATTR_MODEL_LOADING:
            case Core::ATTR_NAME_PREFIX:
            case Core::ATTR_ORACLE_NULLS:
            case Core::ATTR_PERSISTENT:
            case Core::ATTR_PORTABILITY:
            case Core::ATTR_PREFETCH:
            case Core::ATTR_QUERY_CACHE:
            case Core::ATTR_QUERY_CACHE_LIFESPAN:
            case Core::ATTR_QUERY_CLASS:
            case Core::ATTR_QUERY_LIMIT:
            case Core::ATTR_QUOTE_IDENTIFIER:
            case Core::ATTR_RECORD_LISTENER:
            case Core::ATTR_RECURSIVE_MERGE_FIXTURES:
            case Core::ATTR_RESULT_CACHE:
            case Core::ATTR_RESULT_CACHE_LIFESPAN:
            case Core::ATTR_SEQCOL_NAME:
            case Core::ATTR_SEQNAME_FORMAT:
            case Core::ATTR_SERVER_INFO:
            case Core::ATTR_SERVER_VERSION:
            case Core::ATTR_STATEMENT_CLASS:
            case Core::ATTR_STRINGIFY_FETCHES:
            case Core::ATTR_TABLE_CLASS:
            case Core::ATTR_TABLE_CLASS_FORMAT:
            case Core::ATTR_TBLCLASS_FORMAT:
            case Core::ATTR_TBLNAME_FORMAT:
            case Core::ATTR_THROW_EXCEPTIONS:
            case Core::ATTR_TIMEOUT:
            case Core::ATTR_USE_DQL_CALLBACKS:
            case Core::ATTR_USE_NATIVE_ENUM:
            case Core::ATTR_USE_NATIVE_SET:
            case Core::ATTR_VALIDATE:
                $this->attributes[$attribute] = $value;
                break;

            default:
                throw new Exception("Invalid attribute '{$attribute}'! Must be one of Core::ATTR_* constants.");
        }
    }
1106181
public function setElementsAttr($attr, $value) {
		foreach ($this->getElements() as $element) {
			if ($element instanceof Tag) {
				$element->setAttr($attr, $value);
			}
		}
		
		return $this;
	}
1342851
function push($attribute, $value) {
    if (! $this->has($attribute)) {
      return $this;
    }

    $new   = $this->get($attribute);

    if (! is_array($new) && !$new instanceof Traversable) {
      return $this;
    }

    $new[] = $value;
    $this->setPropertyFor($attribute, 'value', $new, 'push');

    return $this;
  }
21549
public function set($attribute, $value)
    {
        list($relationArray, $column, $jsonArray) = FieldNameSlicer::split($attribute);
        $column = $jsonArray ? ($column . '->' . join('->', $jsonArray)) : $column;

        if (count($relationArray) === 0) {
            $this->data->setAttribute($column, $value);

            return;
        }

        $relation = join('.', $relationArray);
        $related = $this->data->getRelationValue($relation);
        if ($related && $related instanceof Model) {
            $related->setAttribute($column, $value);
            $this->relations[$relation] = $related;
        }
    }
1305874
protected function setAttributeFromLdap(array $entry, $attribute, $value)
    {
        if (isset($value['count']) && $value['count'] == 1) {
            $entry[$attribute] = $value[0];
        } elseif (isset($value['count']) && $value['count'] > 0) {
            $entry[$attribute] = [];
            for ($i = 0; $i < $value['count']; $i++) {
                $entry[$attribute][] = $value[$i];
            }
        } elseif ($attribute === 'dn') {
            $entry[$attribute] = $value;
        }

        return $entry;
    }
299766
public function attr($name, $value = null)
    {
        if (func_num_args() < 2) {
            return @$this->attributes[$name];
        } else {
            if (is_null($value)) {
                unset($this->attributes[$name]);
            } else {
                $this->attributes[$name] = $value;
            }
            return $this;
        }
    }
46067
protected function setEntityAttributeValue(Attribute $attribute, $value)
    {
        if (! is_null($value) && ! $value instanceof Value) {
            $model = Attribute::getTypeModel($attribute->getAttribute('type'));
            $instance = new $model();

            $instance->setAttribute('entity_id', $this->getKey());
            $instance->setAttribute('entity_type', $this->getMorphClass());
            $instance->setAttribute($attribute->getForeignKey(), $attribute->getKey());
            $instance->setAttribute('content', $value);

            $value = $instance;
        }

        return $this->setRelation($attribute->getAttribute('slug'), $value);
    }
949180
private function updateAttribute($attribute, $value)
    {
        if (property_exists($this, $attribute)) {
            $this->$attribute = $value;
        }

        return $this;
    }
272726
public function setAttribute($attribute, $value = null)
    {
        if (is_array($attribute)) {
            $this->attributes = array_merge_recursive($this->attributes, $attribute);

            return $this;
        }

        if (is_array($value)) {
            $old = $this->attributes[$attribute] ?? [];
            $this->attributes[$attribute] = array_merge((array) $old, $value);
        } else {
            $this->attributes[$attribute] = $value;
        }

        return $this;
    }
617651
public function setAttribute($attribute, $value)
    {
        if(is_null($value)) {
            unset($this->attributes[$attribute]);
        }
        else {
            $this->attributes[$attribute] = $value;
        }

        return $this;
    }
135315
public function setRowAttributes($values, HtmlAttributes $attr)
    {
        $this->spec_row_values = $values;
        $this->spec_row_attr = $attr;

        return $this;
    }
665163
public function setAttribute($key, $value)
    {
        if ($this->hasSetMutator($key)) {
            $method = sprintf($this->methodNameSetMutator, Str::studly($key));

            return $this->{$method}($value);
        }

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

        return $this;
    }