src/Metable/AttributeBag.php
protected function update($key, $value = null, $group = null)
    {
        if ($key instanceof Attribute) {
            $value = $key->getValue();
            $group = $key->getMetaGroup();
            $key = $key->getMetaKey();
        }

        $this->get($key)->setValue($value);
        $this->get($key)->setMetaGroup($group);

        return $this;
    }
protected function update($key, $value = null, $group = null)
    {
        if ($key instanceof Attribute) {
            $value = $key->getValue();
            $group = $key->getMetaGroup();
            $key = $key->getMetaKey();
        }

        $this->get($key)->setValue($value);
        $this->get($key)->setMetaGroup($group);

        return $this;
    }
protected function update ( $ key , $ value = null , $ group = null ) { if ( $ key instanceof Attribute ) { $ value = $ key -> getValue ( ) ; $ group = $ key -> getMetaGroup ( ) ; $ key = $ key -> getMetaKey ( ) ; } $ this -> get ( $ key ) -> setValue ( $ value ) ; $ this -> get ( $ key ) -> setMetaGroup ( $ group ) ; return $ this ; }
Update existing attribute.

@param  \Sofa\Eloquence\Metable\Attribute|string $key
@param  mixed  $value
@return $this
Update existing attribute .