Prepare the product super attribute label attributes that has to be persisted.

@return array The prepared product super attribute label attributes
485956
protected function prepareProductSuperAttributeLabelAttributes()
    {

        // extract the parent/child ID as well as option value and variation label from the row
        $variationLabel = $this->getValue(ColumnKeys::VARIANT_VARIATION_LABEL);

        // query whether or not we've to create super attribute labels
        if (empty($variationLabel)) {
            $variationLabel = $this->eavAttribute[MemberNames::FRONTENT_LABEL];
        }

        // initialize the attributes and return them
        return $this->initializeEntity(
            array(
                MemberNames::PRODUCT_SUPER_ATTRIBUTE_ID => $this->productSuperAttributeId,
                MemberNames::STORE_ID                   => $this->storeId,
                MemberNames::USE_DEFAULT                => 0,
                MemberNames::VALUE                      => $variationLabel
            )
        );
    }
198438
protected function prepareOptions()
    {
        $options = [];
        foreach ($this->getSelectOptions() as $value => $label) {
            $value     = addslashes($value);
            $label     = addslashes($label);
            $options[] = [
                'sValue' => $value,
                'sLabel' => $label,
            ];
        }

        return $options;
    }
658196
public function init()
    {

        // initialize the prepared statements
        $this->productSuperAttributeStmt =
            $this->getConnection()->prepare($this->loadStatement(SqlStatementKeys::PRODUCT_SUPER_ATTRIBUTE));
    }
247762
private function prepareSetAttributes()
    {
        $fragment = new CNabuPHPMethodBuilder($this, 'setAttributes', CNabuPHPMethodBuilder::METHOD_PROTECTED);
        $fragment->addComment("Set default attributes of $this->entity_name in XML Element.");
        $fragment->addParam(
            'element', 'SimpleXMLElement', false, null, 'SimpleXMLElement',
            'XML Element to set attributes'
        );

        if ($this->is_hashed) {
            $fragment->addFragment(
                "\$element->addAttribute('GUID', \$this->nb_data_object->grantHash(true));"
            );
        }

        if (is_array($this->element_attributes) && count($this->element_attributes) > 0) {
            $fragment->addFragment('$this->putAttributesFromList($element, array(');
            $count = count($this->element_attributes);
            foreach ($this->element_attributes as $field => $attr) {
                $fragment->addFragment("    '$field' => '$attr'" . (--$count > 0 ? ',' : ''));
            }
            $fragment->addFragment('), false);');
        }

        $this->getDocument()->addUse('\SimpleXMLElement');

        $this->addFragment($fragment);
    }
885668
public function getLabelAttributes()
    {
        $result = [];
        $label = $this->element->getLabel();
        foreach ($label->getAttributes() as $attribute => $value) {
            if (null === $value) {
                $result[] = $attribute;
                continue;
            }

            $result[] = "{$attribute}=\"{$value}\"";
        }
        return implode(' ', $result);
    }
572965
protected function initializeProductSuperAttribute(array $attr)
    {

        // load product/attribute ID
        $productId = $attr[MemberNames::PRODUCT_ID];
        $attributeId = $attr[MemberNames::ATTRIBUTE_ID];

        // query whether or not, the product super attribute already exists
        if ($entity = $this->loadProductSuperAttribute($productId, $attributeId)) {
            return $this->mergeEntity($entity, $attr);
        }

        // simply return the attributes
        return $attr;
    }
491477
public function toOptionArray()
    {
        $defaultOptions = $this->defaultOptions();
        $productCondition = $this->productFactory;
        $productAttributes = $productCondition->loadAttributeOptions()
            ->getAttributeOption();
        $pAttributes = [];
        foreach ($productAttributes as $code => $label) {
            if (strpos($code, 'quote_item_') === false) {
                $pAttributes[$code] = $label;
            }
        }
        $options = array_merge($defaultOptions, $pAttributes);

        return $options;
    }
585243
public function prepareAttributes()
    {
        $attrs = [];

        $this->prepare($attrs);

        $attrs = array_merge($attrs, (array) $this->getAttribute('attribs'));

        return $attrs;
    }
190831
public function getBeginEndPreferredLabelPairs()
	{
		$result = parent::getBeginEndPreferredLabelPairs();
		$result[] = array(
			self::$originallyStatedLabel,
			XBRL_Constants::$labelRoleRestatedLabel,
		);
		$result[] = array(
			// self::$originallyStatedLabel,
			XBRL_Constants::$labelRoleVerboseLabel,
		);

		return $result;
	}
101089
protected function buildAttributes()
    {
        $attrs = array();

        $class = '';

        if(count($this->classes) > 0)
            $class = 'class="'.implode(' ', $this->classes).'" ';

        if(count($this->attributeString) > 0)
            $attrs = $this->attributeString;

        foreach($this->attributes as $key => $value)
            $attrs[] = $key.'="'.$value.'"';

        return $class.implode(' ', $attrs);
    }
48761
protected function validateAttributeProduct()
    {
        $fields = $this->getSubmitted('product_fields.attribute');

        if (empty($fields)) {
            return null;
        }

        $attributes = $this->getSubmitted('field.attribute');

        $errors = 0;

        foreach ($fields as $field_id => $field) {
            if (!empty($field['required']) && empty($attributes[$field_id])) {
                $this->setErrorRequired("attribute.$field_id", $field['title']);
                $errors++;
            }
        }

        return empty($errors);
    }
355132
protected function prepareAttributes()
    {

        // initialize the values that has to be updated
        $updatedAt = date('Y-m-d H:i:s');
        $childrenCount = $this->loadCategoryChildrenChildrenCount($this->category[MemberNames::PATH] . '/%');

        // prepare and return the array with the updated values
        return array(
            MemberNames::UPDATED_AT     => $updatedAt,
            MemberNames::CHILDREN_COUNT => $childrenCount
        );
    }
835203
protected function prepareProductRelationAttributes()
    {

        // initialize and return the entity
        return $this->initializeEntity(
            array(
                MemberNames::PARENT_ID => $this->parentId,
                MemberNames::CHILD_ID  => $this->childId
            )
        );
    }
1225572
protected function getSafeAttributes()
    {
        $ignored = array_merge(
            $this->tracker->getAdditions(),
            $this->tracker->getDeletions(),
            $this->tracker->getReplacements()
        );
        $attributes = array();
        foreach ($this->getAttributes() as $attribute) {
            if (in_array($attribute->getName(), $ignored)) {
                continue;
            }
            $attributes[$attribute->getName()] = $attribute;
        }
        return $attributes;
    }
310861
public function defineAttributes()
    {
        return array(
            'providerHandle' => array(AttributeType::String, 'required' => true),
            'pluginHandle' => array(AttributeType::String, 'required' => true),

            'accessToken' => array(AttributeType::String, 'column' => ColumnType::Text),
            'secret' => array(AttributeType::String, 'column' => ColumnType::Text),
            'endOfLife' => AttributeType::String,
            'refreshToken' => array(AttributeType::String, 'column' => ColumnType::Text),
        );
    }
189356
protected function initializeProductSuperAttributeLabel(array $attr)
    {

        // load product super attribute/store ID
        $storeId = $attr[MemberNames::STORE_ID];
        $productSuperAttributeId = $attr[MemberNames::PRODUCT_SUPER_ATTRIBUTE_ID];

        // query whether or not, the product super attribute label already exists
        if ($entity = $this->loadProductSuperAttributeLabel($productSuperAttributeId, $storeId)) {
            return $this->mergeEntity($entity, $attr);
        }

        // simply return the attributes
        return $attr;
    }
777211
public function getAttributes()
    {
        return [
            Attributes\IdAttribute::make(),
            Attributes\UuidAttribute::make(),
            Attributes\TextAttribute::make('name')
                ->setRequired(true),
            Attributes\TextAttribute::make('code'),
            Attributes\LongTextAttribute::make('description'),
            Attributes\BelongsToAttribute::make('type_id')
                ->setRelationName('type')
                ->setRelationManager(ProductTypeManager::class),
            Attributes\BelongsToAttribute::make('parent_id')
                ->setRelationName('parent')
                ->setRelationManager(ProductManager::class),
            Attributes\BelongsToAttribute::make('supplier_id')
                ->setRelationName('supplier')
                ->setRelationManager(SupplierManager::class),
            Attributes\CreatedAtAttribute::make(),
            Attributes\UpdatedAtAttribute::make(),
            Attributes\DeletedAtAttribute::make(),
        ];
    }