Check if value can be assigned to current attribute<br>

If Entity has an ID and attribute 'once' flag is set and attribute has a value assigned to it
then a new value should not be assigned.

@return bool
352269
protected function canAssign()
    {
        if ($this->parent->id && $this->getOnce() && $this->value !== null) {
            return false;
        }

        return true;
    }
1276099
public function isSetter() {
    	$methodName = $this->getName();
    	
    	   
    	if (strpos($methodName, "set") === 0 && strlen($methodName)>3) {
    		// A setter must have exactly one compulsory parameter
    		$parameters = $this->getParameters();
    		if (count($parameters) == 0) {
    			return false;
    		}
    		if (count($parameters)>1) {
    			for ($i=1, $count=count($parameters); $i<$count; $i++) {
    				$param = $parameters[$i];
    				if (!$param->isDefaultValueAvailable()) {
    					return false;
    				}
    			}
    		}
    		
    		return true;
    	}
    	return false;
    }
171003
public function validateRequired()
    {
        parent::validateRequired();

        if (!is_array($this->getAttribute('container'))) {
            $message = 'Container attribute must be an array.';

            throw new AdldapException($message);
        }

        return true;
    }
1212463
public function current()
    {
        $sKey = key($this->values);

        return (true === isset($this->values[$sKey])) ? $this->values[$sKey] : null;
    }
1210506
public function containsOr()
	{
		$args = (new static(func_get_args()))->flattenIt();

		$found = $args->detect(function($value) {
			return in_array($value, $this->attributes);
		});

		return !is_null($found);
	}
6961
public function immutable()
    {
        $this->isImmutable = true;

        // Lock nested items.
        foreach ($this->getArrayCopy() as $item) {
            if ($item instanceof MultiValue) {
                $item->immutable();
            }
        }
        return $this;
    }
950864
public function sure()
    {

        $this->_label = null;
        switch ($this->called) {
        case 'textarea':
            $i = 2;
            break;
        default:
            $i = 1;
            break;
        }
        if (isset($this->args[$i])) {
            $this->_label = $this->args[$i];
        }

        return true;
    }
637370
final public function hasAttribute (string $attribute) : bool
	{
		$objectAttributes = $this->attributes();
		return array_key_exists($attribute, $objectAttributes);
	}
168391
public function isActuallyDirty()
    {
        $values = $this->owner->getDirtyAttributes();
        if (isset($this->fields['modifiedField'])) {
            unset($values[$this->fields['modifiedField']]);
        }
        if (isset($this->fields['modifiedByField'])) {
            unset($values[$this->fields['modifiedByField']]);
        }
        if (isset($this->fields['createdField'])) {
            unset($values[$this->fields['createdField']]);
        }
        if (isset($this->fields['createdByField'])) {
            unset($values[$this->fields['createdByField']]);
        }

        return !empty($values);
    }
1337419
protected function checkAttributeAssignable($attribute): void
    {
        if (empty($this->assignable)) {
            return;
        }

        if (is_array($attribute)) {

            foreach ($attribute as $singleAttribute) {
                $this->checkAttributeAssignable($singleAttribute);
            }

            return;
        }

        if ( ! in_array($attribute, $this->assignable)) {
            throw new UnassignableAttributeException("Not allowed to assign value for '{$attribute}'");
        }
    }
825363
public function hasAttributeValue($name, $value = null)
    {
        if (!$this->hasAttribute($name)) {
            return false;
        }
        return (empty($value))? true : (array_search($value, $this->getArrayAttribute($name)) !== false);
    }
1010414
public function isStorable()
    {
        return
            ! $this->isReadOnly() &&
            ! $this->isHidden() &&
            $this->getFieldRelation() == Field::NORMAL &&
            $this->isStorable;
    }
947833
public function isObjEditable()
    {
        $model = ($this->currentObj) ? $this->currentObj : $this->proto();
        $method = [ $model, 'isEditable' ];

        if (is_callable($method)) {
            return call_user_func($method);
        }

        return true;
    }
987916
public function isChanged()
    {
        // When unbound, use the local changed flag
        if (! ($this->record instanceof DataObject)) {
            return $this->isChanged;
        }

        // Defer to parent record
        foreach ($this->compositeDatabaseFields() as $field => $spec) {
            $key = $this->getName() . $field;
            if ($this->record->isChanged($key)) {
                return true;
            }
        }
        return false;
    }
1163748
public function validates()
    {
        $currentAttributeValues = array();

        if ($this->isBound()) {
            foreach ($this->getAttributeNames() as $name) {
                $currentAttributeValues[$name] = $this->{$name};
            }
        }

        return $this->validate(array(
            $this->getInputName() => $currentAttributeValues
        ));
    }
984051
public function setAttributeId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->attribute_id !== $v) {
            $this->attribute_id = $v;
            $this->modifiedColumns[AttributeAttributeTypeTableMap::ATTRIBUTE_ID] = true;
        }

        if ($this->aAttribute !== null && $this->aAttribute->getId() !== $v) {
            $this->aAttribute = null;
        }


        return $this;
    }
862638
public function canAcceptFormData()
    {
        if ($this->_blCanAcceptFormData === null) {
            $this->_blCanAcceptFormData = false;

            $formId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("uformid");
            $sessionFormId = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("sessionuformid");

            // testing if form and session ids matches
            if ($formId && $formId === $sessionFormId) {
                $this->_blCanAcceptFormData = true;
            }

            // regenerating form data
            $this->getFormId();
        }

        return $this->_blCanAcceptFormData;
    }