Znajduje atrybut
@param integer $attributeId
@return \Cms\Orm\CmsAttributeRecord
552504
private function _findAttributeById($attributeId)
    {
        //iteracja po atrybutach
        foreach ($this->_cmsAttributes as $attribute) {
            //atrybut znaleziony
            if ($attribute->id == $attributeId) {
                return $attribute;
            }
        }
    }
178537
protected function getAttribute($attributePath)
    {
        list($familyCode, $attributeCode) = explode('.', $attributePath);
        $family = $this->familyRegistry->getFamily($familyCode);

        return $family->getAttribute($attributeCode);
    }
240724
public function attr($attribute)
    {
        if (!$this->attributes instanceof EntityAttributeContainer) {
            $this->attributes = $this->createEntityAttributeContainer();
        }

        return $this->attributes->attr($attribute);
    }
524360
private function _scalarValueByAttribute(\Cms\Orm\CmsAttributeRecord $attribute)
    {
        //iteracja po wartościach
        foreach ($this->_cmsAttributeValues as $valueRecord) {
            //znaleziony atrybut
            if ($valueRecord->cmsAttributeId == $attribute->id) {
                //zwrot wartości
                return $valueRecord->value;
            }
        }
        return $attribute->getJoined('cms_attribute_value')->value;
    }
419645
public function setAttributeValue(\Sulu\Bundle\ProductBundle\Entity\AttributeValue $attributeValue)
    {
        $this->attributeValue = $attributeValue;

        return $this;
    }
561451
private function _arrayValueByAttribute(\Cms\Orm\CmsAttributeRecord $attribute)
    {
        //tablica wartości
        $values = [];
        //iteracja po wartościach
        foreach ($this->_cmsAttributeValues as $valueRecord) {
            //znaleziony atrybut
            if ($valueRecord->cmsAttributeId == $attribute->id) {
                //dodanie wartości
                $values[] = $valueRecord->value;
            }
        }
        //brak wartości - ustawienie domyślnej jeśli istnieje
        if (empty($values) && $attribute->getJoined('cms_attribute_value')->value) {
            //zwrot domyślnej wartości
            return [$attribute->getJoined('cms_attribute_value')->value];
        }
        //zwrot znalezionych wartości
        return $values;
    }
731548
public function getAttributes()
    {
        return (new CmsAttributeQuery)
                ->join('cms_attribute_relation')->on('id', 'cms_attribute_id')
                ->join('cms_attribute_type')->on('cms_attribute_type_id')
                ->joinLeft('cms_attribute_value', 'cms_attribute_relation')->on('cms_attribute_value_id')
                ->where('object', 'cms_attribute_relation')->equals($this->_object)
                ->where('objectId', 'cms_attribute_relation')->equals($this->_objectId)
                ->orderAsc('order', 'cms_attribute_relation')
                ->orderAsc('id', 'cms_attribute_relation')
                ->find();
    }
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;
    }
735693
function addAttribute( $attributeID )
    {
        $status = false;
        if ( is_numeric( $attributeID ) )
        {
            $classAttribute = eZContentClassAttribute::fetch( $attributeID );
            if ( $classAttribute instanceof eZContentClassAttribute )
            {
                if ( $classAttribute->attribute( 'data_type_string' ) == 'ezisbn' )
                {
                    if ( $classAttribute->attribute( 'data_int1' ) == 1 or $this->Force === true )
                    {
                        $this->AttributeArray[$classAttribute->attribute( 'id' )] = $classAttribute;
                    }
                    else
                    {
                        $this->Cli->output( $this->Cli->stylize( 'warning', 'Warning:' ) . ' The attribute id ' .
                                            $this->Cli->stylize( 'strong', $attributeID ) . ' is not set to ISBN-13. Use --force to set the ISBN-13 flag' );
                    }
                }
                else
                {
                    $this->Cli->output( $this->Cli->stylize( 'warning', 'Warning:' ) . ' The attribute id ' .
                                        $this->Cli->stylize( 'strong', $attributeID ) . ' is not an ISBN datatype but of type ' .
                                        $this->Cli->stylize( 'strong', $classAttribute->attribute( 'data_type_string' ) ) . '.' );
                }
            }
            else
            {
                $this->Cli->output( $this->Cli->stylize( 'warning', 'Warning:' ) . ' The attribute id ' .
                                    $this->Cli->stylize( 'strong', $attributeID ) . ' does not exist.' );
            }
        }
        else if ( $attributeID !== null )
        {
            $this->Cli->output( $this->Cli->stylize( 'error', 'Error:' ) . ' the attribute id need to be numeric.' );
            $status = true;
        }

        return $status;
    }
301136
private function getAttributeCode()
    {
        $attributeCode = false;

        if ($this->request->isAjax() && $this->request->getParam('filterName')) {
            $attributeCode = (string) $this->request->getParam('filterName');
        }

        return $attributeCode;
    }
918706
public function showAction($attributeId, $id)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Attribute $attribute */
        $attribute = $em->getRepository('EcommerceBundle:Attribute')->find($attributeId);

        if (!$attribute) {
            throw $this->createNotFoundException('Unable to find Attribute entity.');
        }

        /** @var AttributeValue $entity */
        $entity = $em->getRepository('EcommerceBundle:AttributeValue')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find AttributeValue entity.');
        }

        $deleteForm = $this->createDeleteForm($attributeId, $id);

        return array(
            'entity'      => $entity,
            'attribute'   => $attribute,
            'delete_form' => $deleteForm->createView(),
        );
    }
193606
public function createAttribute($code, array $attributeConfiguration = [])
    {
        $attributeClass = $this->attributeClass;
        /** @var AttributeInterface $attribute */
        $attribute = new $attributeClass(
            $code,
            $this->attributeTypeRegistry,
            $attributeConfiguration,
            $this->globalContextMask
        );
        if (method_exists($attribute, 'setTranslator')) {
            $attribute->setTranslator($this->translator);
        }

        return $attribute;
    }
419488
public function setAttributeSetFilter($setId)
    {
        if (is_array($setId)) {
            if (!empty($setId)) {
                $this->join(
                    ['entity_attribute' => $this->getTable('eav_entity_attribute')],
                    'entity_attribute.attribute_id = main_table.attribute_id',
                    []
                );
                $this->addFieldToFilter('entity_attribute.attribute_set_id', ['in' => $setId]);
                $this->addAttributeGrouping();
            }
        } elseif ($setId) {
            $this->join(
                ['entity_attribute' => $this->getTable('eav_entity_attribute')],
                'entity_attribute.attribute_id = main_table.attribute_id',
                []
            );
            $this->addFieldToFilter('entity_attribute.attribute_set_id', $setId);
        }

        return $this;
    }
695411
public function attribute( $attributeName )
    {
        if ( property_exists( $this, $attributeName ) )
            return $this->$attributeName;
        elseif ( $this->__isset( $attributeName ) )
            return $this->__get( $attributeName );
        else
            eZDebug::writeError( "Attribute '$attributeName' does not exist", __METHOD__ );
    }
999269
public function createAttributeValueRelation($attributeValueId)
    {
        //niepoprawna kategoria
        if (null === $attributeValueRecord = (new CmsAttributeValueQuery)
                ->findPk($attributeValueId)) {
            return;
        }
        //wyszukiwanie relacji
        $relationRecord = (new CmsAttributeValueRelationQuery)
            ->whereCmsAttributeValueId()->equals($attributeValueRecord->id)
            ->andFieldObject()->equals($this->_object)
            ->andFieldObjectId()->equals($this->_objectId)
            ->findFirst();
        //znaleziona relacja - nic do zrobienia
        if (null !== $relationRecord) {
            return;
        }
        //tworzenie relacji
        $newRelationRecord = new CmsAttributeValueRelationRecord;
        $newRelationRecord->cmsAttributeValueId = $attributeValueRecord->id;
        $newRelationRecord->object = $this->_object;
        $newRelationRecord->objectId = $this->_objectId;
        //zapis
        $newRelationRecord->save();
    }
248197
public function newAction($attributeId)
    {
        $em = $this->getDoctrine()->getManager();

       
        /** @var Attribute $attribute */
        $attribute = $em->getRepository('EcommerceBundle:Attribute')->find($attributeId);

        if (!$attribute) {
            throw $this->createNotFoundException('Unable to find Attribute entity.');
        }

        $entity = new AttributeValue();
        $form   = $this->createForm(new AttributeValueType(), $entity);

        return array(
            'entity'      => $entity,
            'attribute'   => $attribute,
            'form'        => $form->createView(),
        );
    }
627704
static public function fetchReverseRelatedObjectsID( $objectID, $attributeID, $allRelations )
    {
        if ( !is_array( $allRelations ) || $allRelations === array() )
        {
            $allRelations = array( 'common', 'xml_embed', 'attribute' );
            if ( eZContentObject::isObjectRelationTyped() )
            {
                $allRelations[] = 'xml_link';
            }
        }

        $relatedObjectsTyped = array();
        foreach ( $allRelations as $relationType )
        {
            $relatedObjectsTyped[$relationType] =
                eZContentFunctionCollection::fetchReverseRelatedObjects( $objectID, $attributeID, array( $relationType ), false, array(), null );
        }

        $relatedObjectsTypedIDArray = array();
        foreach ( $relatedObjectsTyped as $relationTypeName => $relatedObjectsByType )
        {
            $relatedObjectsTypedIDArray[$relationTypeName] = array();
            foreach ( $relatedObjectsByType['result'] as $relatedObjectByType )
            {
                $relatedObjectsTypedIDArray[$relationTypeName][] = $relatedObjectByType->ID;
            }
        }

        return array( 'result' =>$relatedObjectsTypedIDArray );
    }