Sulu\Bundle\MediaBundle\Entity\MediaType::setName PHP Méthode

setName() public méthode

Set name.
public setName ( string $name ) : MediaType
$name string
Résultat MediaType
    public function setName($name)
    {
        $this->name = $name;
        return $this;
    }

Usage Example

 protected function setUpMedia()
 {
     // Create Media Type
     $documentType = new MediaType();
     $documentType->setName('document');
     $documentType->setDescription('This is a document');
     $imageType = new MediaType();
     $imageType->setName('image');
     $imageType->setDescription('This is an image');
     $videoType = new MediaType();
     $videoType->setName('video');
     $videoType->setDescription('This is a video');
     $this->mediaTypes['image'] = $imageType;
     $this->mediaTypes['video'] = $videoType;
     // create some tags
     $tag1 = new Tag();
     $tag1->setName('Tag 1');
     $tag2 = new Tag();
     $tag2->setName('Tag 2');
     $this->em->persist($tag1);
     $this->em->persist($tag2);
     $this->em->persist($documentType);
     $this->em->persist($imageType);
     $this->em->persist($videoType);
     $this->em->flush();
 }
All Usage Examples Of Sulu\Bundle\MediaBundle\Entity\MediaType::setName