@param AttributeInterface $attribute
@param array|null         $context

@throws InvalidValueDataException
@throws MissingAttributeException
@throws ContextException

@return bool
326724
public function isEmpty(AttributeInterface $attribute, array $context = null)
    {
        foreach ($this->getValuesData($attribute, $context) as $valueData) {
            if (null !== $valueData && '' !== $valueData) {
                return false;
            }
        }

        return true;
    }
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}'");
        }
    }
508371
public function setTableAttribute($attribute, $value = null)
    {
        if (is_array($attribute)) {
            return $this->setTableAttributes($attribute);
        }

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

        return $this;
    }
372355
protected function setInternalValuesData(AttributeInterface $attribute, $dataValues, array $context = null)
    {
        $this->checkAttribute($attribute);
        $dataValues = $this->ensureNativeArray($dataValues, $this->getFamilyCode().'.'.$attribute->getCode());
        $values = new ArrayCollection();
        $position = 0; // Reset position to zero

        foreach ($this->getInternalValues($attribute, $context) as $value) {
            // If there values to replace
            if (\count($dataValues)) {
                // Extract new values and replaces them one by one
                $dataValue = array_shift($dataValues);
                $value->setPosition(++$position);
                $this->setInternalValueData($attribute, $value, $dataValue);
                $values->add($value);
            } else {
                // If there are too much existing values previously, remove the extra ones
                $this->removeValue($value);
            }
        }

        // If there are still values to add
        foreach ($dataValues as $dataValue) {
            $value = $this->createValue($attribute, $context);
            $value->setPosition(++$position);
            $this->setInternalValueData($attribute, $value, $dataValue);
            $values->add($value);
        }

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

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

        return $this->addValueData($attribute, $value, $context);
    }
1269655
public function getAttribute($attribute)
    {
        //Check this attribute is support
        if (isset($this->input_map[$attribute])) {
            return $this->input_map[$attribute];
        } else {
            throw new AttributeInvalidException('Attribute not supported by this library');
        }
    }
72191
public function setNativeDataProperty(
        Context $context,
        NameValue $name,
        callable $getter,
        callable $setter = null,
        int $attributes = PropertyAttribute::NONE
    ): bool {
    }
1277127
public function getRefererDatas(
        FamilyInterface $family = null,
        AttributeInterface $attribute = null,
        array $context = null
    ) {
        $datas = new ArrayCollection();
        foreach ($this->getRefererValues($family, $attribute, $context) as $refererValue) {
            $data = $refererValue->getData();
            if ($data) {
                $datas[] = $data;
            }
        }

        return $datas;
    }
504515
public function addAttribute(AttributeInterface $attribute)
    {
        if (!$this
            ->attributes
            ->contains($attribute)) {
            $this
                ->attributes
                ->add($attribute);
        }

        return $this;
    }
494009
protected function isInitDatetime($attribute)
    {
        if ($this->timeFormat === static::$timeFormatDatetime) {
            return $attribute == static::$initDatetime || $attribute == null;
        }
        if ($this->timeFormat === static::$timeFormatTimestamp) {
            return $attribute == static::$initTimestamp || $attribute == null;
        }
        return false;
    }
113736
protected function isAllowedAttribute(
        DataInterface $object,
        $attribute,
        /** @noinspection PhpUnusedParameterInspection */
        $format = null,
        array $context = []
    ) {
        // If normalizing by reference, we just check if it's among the allowed attributes
        if ($this->byReferenceHandler->isByReference($context)) {
            return \in_array($attribute, $this->referenceAttributes, true);
        }

        // Check ignored attributes
        if (\in_array($attribute, $this->ignoredAttributes, true)) {
            return false;
        }

        return $this->isGroupAllowed($object, $attribute, $context);
    }
183596
public function addAttributeValue(AttributeValueInterface $attributeValue)
    {
        if (!$this->attributeValues->contains($attributeValue)) {
            $attributeValue->setSubject($this);
            $this->attributeValues->add($attributeValue);
        }

        return $this;
    }
49871
protected function getValuesByAttribute(AttributeInterface $attribute)
    {
        if (null === $this->valuesByAttributes) {
            $this->valuesByAttributes = [];
        }

        if (!array_key_exists($attribute->getCode(), $this->valuesByAttributes)) {
            $this->valuesByAttributes[$attribute->getCode()] = [];
            foreach ($this->values as $value) {
                if ($value->getAttributeCode() === $attribute->getCode()) {
                    $this->addValueByAttribute($value);
                }
            }
        }

        return $this->valuesByAttributes[$attribute->getCode()];
    }
1082220
protected function parseResult(DataInterface $data, AttributeInterface $attribute = null)
    {
        if ($attribute) {
            if ($attribute->getType()->isRelation() || $attribute->getType()->isEmbedded()) {
                // This is not perfect as it does not uses the OptionResolver of the form type to resolve the 'choice_label'
                $label = $this->computeLabelHelper->computeLabel($data, $data->getId(), $attribute->getFormOptions());
            } else {
                $label = $data->get($attribute->getCode());
            }
        } else {
            $label = (string) $data;
        }

        return [
            'id' => $data->getId(),
            'text' => $label,
        ];
    }
1015558
private function loadValidatorAttribute(array &$property, AttributeItem $attribute)
    {
        /* @var $element Element */
        $type = $attribute->getType();

        $this->loadValidatorType($property, $type, false);

        // Required properties
        if ($attribute instanceof Attribute) {
            if ($attribute->getUse() === Attribute::USE_REQUIRED) {
                $property['validation'][] = [
                    'NotNull' => null
                ];
            }
        }
    }
1047220
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
    {
        $user = $token->getUser();
        if (!$user instanceof UserInterface) {
            return false;
        }

        return $this->canDelete($subject);
    }
281982
public function has($attribute, $value = null)
    {
        if (!array_key_exists(strtolower($attribute), array_change_key_case($this->attributes))) {
            return false;
        }

        return is_null($value) ?: $this->attributeHasValue($attribute, $value);
    }