setTitle() public method

Set title.
public setTitle ( string $title ) : CollectionMeta
$title string
return CollectionMeta
Example #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);
 }
 private function createCollection($typeName, $title = [], $parent = null)
 {
     // Collection
     $collection = new Collection();
     $style = ['type' => 'circle', 'color' => '#ffcc00'];
     $collection->setStyle(json_encode($style));
     // Create Collection Type
     $collectionType = new CollectionType();
     $collectionType->setName($typeName);
     $collectionType->setDescription('Default Collection Type');
     $collection->setType($collectionType);
     // Collection Meta 1
     $collectionMeta = new CollectionMeta();
     $collectionMeta->setTitle(isset($title['en-gb']) ? $title['en-gb'] : 'Collection');
     $collectionMeta->setDescription('This Description is only for testing');
     $collectionMeta->setLocale('en-gb');
     $collectionMeta->setCollection($collection);
     $collection->setDefaultMeta($collectionMeta);
     $collection->addMeta($collectionMeta);
     // Collection Meta 2
     $collectionMeta2 = new CollectionMeta();
     $collectionMeta2->setTitle(isset($title['de']) ? $title['de'] : 'Kollection');
     $collectionMeta2->setDescription('Dies ist eine Test Beschreibung');
     $collectionMeta2->setLocale('de');
     $collectionMeta2->setCollection($collection);
     $collection->addMeta($collectionMeta2);
     $collection->setParent($parent);
     $this->em->persist($collection);
     $this->em->persist($collectionType);
     $this->em->persist($collectionMeta);
     $this->em->persist($collectionMeta2);
     $this->em->flush();
     return $collection;
 }
 private function createCollection($name, $parent, $collectionType)
 {
     $collection = new Collection();
     $collectionMeta = new CollectionMeta();
     $collectionMeta->setTitle($name);
     $collectionMeta->setLocale('en-gb');
     $collection->setType($collectionType);
     $collectionMeta->setCollection($collection);
     $collection->addMeta($collectionMeta);
     if ($parent !== null) {
         $collection->setParent($this->collections[$parent]);
         $this->collections[$parent]->addChildren($collection);
     }
     $this->em->persist($collection);
     $this->em->persist($collectionMeta);
     return $collection;
 }
Example #4
0
 /**
  * Get or create a media collection.
  *
  * @param string $name Name of collection to get or create
  *
  * @return Collection
  */
 private function getOrCreateMediaCollection($name)
 {
     $manager = $this->getEntityManager();
     $collectionMeta = $manager->getRepository('SuluMediaBundle:CollectionMeta')->findOneByTitle($name);
     if ($collectionMeta) {
         return $collectionMeta->getCollection();
     }
     $collection = new Collection();
     $collection->setType($this->getOrCreateCollectionType('Default'));
     $collectionMeta = new CollectionMeta();
     $collectionMeta->setTitle($name);
     $collectionMeta->setDescription('Dies ist eine Test Beschreibung');
     $collectionMeta->setLocale('en');
     $collectionMeta->setCollection($collection);
     $collection->addMeta($collectionMeta);
     $manager->persist($collection);
     $manager->persist($collectionMeta);
     $manager->flush();
     $this->lastCollection = $collection;
     return $collection;
 }
 private function createCollection($name, $parent = null)
 {
     $collection = new Collection();
     $collectionType = new CollectionType();
     $collectionType->setName($name);
     $collectionType->setDescription('Default Collection Type');
     $collectionMeta = new CollectionMeta();
     $collectionMeta->setTitle('Test Collection');
     $collectionMeta->setDescription('This Description is only for testing');
     $collectionMeta->setLocale('en-gb');
     $collection->setType($collectionType);
     $collectionMeta->setCollection($collection);
     $collection->addMeta($collectionMeta);
     if ($parent !== null) {
         $collection->setParent($this->collections[$parent]);
         $this->collections[$parent]->addChildren($collection);
     }
     $this->em->persist($collection);
     $this->em->persist($collectionMeta);
     $this->em->persist($collectionType);
     return $collection;
 }