public function set($attributeCode, $value, array $context = null)
    {
        $attribute = $this->getAttribute($attributeCode);

        $method = 'set'.ucfirst($attributeCode);
        if (method_exists($this, $method)) {
            return $this->$method($value, $context);
        }

        if ($attribute->isCollection()) {
            return $this->setValuesData($attribute, $value, $context);
        }

        return $this->setValueData($attribute, $value, $context);
    }
public function set($attributeCode, $value, array $context = null)
    {
        $attribute = $this->getAttribute($attributeCode);

        $method = 'set'.ucfirst($attributeCode);
        if (method_exists($this, $method)) {
            return $this->$method($value, $context);
        }

        if ($attribute->isCollection()) {
            return $this->setValuesData($attribute, $value, $context);
        }

        return $this->setValueData($attribute, $value, $context);
    }
public function set ( $ attributeCode , $ value , array $ context = null ) { $ attribute = $ this -> getAttribute ( $ attributeCode ) ; $ method = 'set' . ucfirst ( $ attributeCode ) ; if ( method_exists ( $ this , $ method ) ) { return $ this -> $ method ( $ value , $ context ) ; } if ( $ attribute -> isCollection ( ) ) { return $ this -> setValuesData ( $ attribute , $ value , $ context ) ; } return $ this -> setValueData ( $ attribute , $ value , $ context ) ; }
Used to set values as in a simple way

@param string     $attributeCode
@param mixed      $value
@param array|null $context

@throws InvalidValueDataException
@throws MissingAttributeException
@throws ContextException

@return DataInterface
Used to set values as in a simple way