src/Sulu/Bundle/CategoryBundle/Api/Category.php
public function setMeta($metaEntities)
    {
        $currentMeta = $this->entity->getMeta();
        foreach ($metaEntities as $singleMeta) {
            $metaEntity = $this->getSingleMetaById($currentMeta, $singleMeta->getId());
            if (!$metaEntity) {
                $metaEntity = $singleMeta;
                $this->entity->addMeta($metaEntity);
            }

            $metaEntity->setCategory($this->entity);
            $metaEntity->setKey($singleMeta->getKey());
            $metaEntity->setValue($singleMeta->getValue());
            $metaEntity->setLocale($singleMeta->getLocale());
        }

        return $this;
    }
public function setMeta($metaEntities)
    {
        $currentMeta = $this->entity->getMeta();
        foreach ($metaEntities as $singleMeta) {
            $metaEntity = $this->getSingleMetaById($currentMeta, $singleMeta->getId());
            if (!$metaEntity) {
                $metaEntity = $singleMeta;
                $this->entity->addMeta($metaEntity);
            }

            $metaEntity->setCategory($this->entity);
            $metaEntity->setKey($singleMeta->getKey());
            $metaEntity->setValue($singleMeta->getValue());
            $metaEntity->setLocale($singleMeta->getLocale());
        }

        return $this;
    }
public function setMeta ( $ metaEntities ) { $ currentMeta = $ this -> entity -> getMeta ( ) ; foreach ( $ metaEntities as $ singleMeta ) { $ metaEntity = $ this -> getSingleMetaById ( $ currentMeta , $ singleMeta -> getId ( ) ) ; if ( ! $ metaEntity ) { $ metaEntity = $ singleMeta ; $ this -> entity -> addMeta ( $ metaEntity ) ; } $ metaEntity -> setCategory ( $ this -> entity ) ; $ metaEntity -> setKey ( $ singleMeta -> getKey ( ) ) ; $ metaEntity -> setValue ( $ singleMeta -> getValue ( ) ) ; $ metaEntity -> setLocale ( $ singleMeta -> getLocale ( ) ) ; } return $ this ; }
Takes meta as array and sets it to the entity.

@param CategoryMetaInterface[] $metaEntities

@return Category
Takes meta as array and sets it to the entity .