Sulu\Bundle\MediaBundle\Entity\CollectionType::setName PHP Method

setName() public method

Set name.
public setName ( string $name )
$name string
    public function setName($name)
    {
        $this->name = $name;
        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 protected function setUpCollection()
 {
     $this->collection = new Collection();
     $style = ['type' => 'circle', 'color' => '#ffcc00'];
     $this->collection->setStyle(json_encode($style));
     // Create Collection Type
     $this->collectionType = new CollectionType();
     $this->collectionType->setName('Default Collection Type');
     $this->collectionType->setDescription('Default Collection Type');
     $this->collection->setType($this->collectionType);
     // Collection Meta 1
     $this->collectionMeta = new CollectionMeta();
     $this->collectionMeta->setTitle('Test Collection');
     $this->collectionMeta->setDescription('This Description is only for testing');
     $this->collectionMeta->setLocale('en-gb');
     $this->collectionMeta->setCollection($this->collection);
     $this->collection->addMeta($this->collectionMeta);
     // Collection Meta 2
     $collectionMeta2 = new CollectionMeta();
     $collectionMeta2->setTitle('Test Kollektion');
     $collectionMeta2->setDescription('Dies ist eine Test Beschreibung');
     $collectionMeta2->setLocale('de');
     $collectionMeta2->setCollection($this->collection);
     $this->collection->addMeta($collectionMeta2);
     $this->em->persist($this->collection);
     $this->em->persist($this->collectionType);
     $this->em->persist($this->collectionMeta);
     $this->em->persist($collectionMeta2);
 }
All Usage Examples Of Sulu\Bundle\MediaBundle\Entity\CollectionType::setName