Example #1
0
 public function load(ObjectManager $manager)
 {
     $phpbb4 = new Media();
     $phpbb4->setMediatype($this->getReference('video'));
     $phpbb4->setDate(new \Datetime('16-07-2013'));
     $phpbb4->setCreationDate(new \DateTime('16-07-2013'));
     $phpbb4->setTitle('phpBB4: Building end-user applications with Symfony2');
     $phpbb4->setContent('<iframe class="player" frameborder="0" scrolling="no" src="http://playertv-bscdn-admin.pad-playertv.brainsonic.com/web//player-html5-568.html" width="400" height="300"><noframes><img alt="&lt;h2&gt;3 Mars Session 05 Symfony&lt;/h2&gt;" src="http://playertv-bscdn-admin.pad-playertv.brainsonic.com/uploads/32/20110309-193143/photo_1.jpg" /><h2>3 Mars Session 05 Symfony</h2></noframes></iframe>');
     $phpbb4->setLength('04:00');
     $phpbb4->setRating(2.5);
     $phpbb4->setVisits(100);
     $phpbb4->setLanguage('EN');
     $phpbb4->setHostName('Symfony');
     $phpbb4->setHostUrl('http://symfony.com/video/Paris2011/568');
     $phpbb4->setStatus('pub');
     $toolUpYourLampStack = new Media();
     $toolUpYourLampStack->setMediatype($this->getReference('video'));
     $toolUpYourLampStack->setDate(new \DateTime('15-07-2013'));
     $toolUpYourLampStack->setCreationDate(new \DateTime('15-07-2013'));
     $toolUpYourLampStack->setTitle('Tool Up Your Lamp Stack');
     $toolUpYourLampStack->setDescription('A talk about peripheral tools that aid web development');
     $toolUpYourLampStack->setContent("<iframe src=\"http://player.vimeo.com/video/30012690\" width=\"500\" height=\"409\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>");
     $toolUpYourLampStack->setLength('1hr 20mins');
     $toolUpYourLampStack->setRating(0);
     $toolUpYourLampStack->setVisits(100);
     $toolUpYourLampStack->setLanguage('en');
     $toolUpYourLampStack->setHostName('Vimeo');
     $toolUpYourLampStack->setHostUrl('http://vimeo.com/30012690/');
     $toolUpYourLampStack->setStatus('pub');
     $manager->persist($phpbb4);
     $manager->persist($toolUpYourLampStack);
     $manager->flush();
     $this->addReference('phpbb4', $phpbb4);
     $this->addReference('toolUpYourLampStack', $toolUpYourLampStack);
 }
Example #2
0
 /**
  * Insert media item
  *
  * @param $importItem
  * @param \Protalk\MediaBundle\Entity\Media $media
  */
 protected function insertMedia($importItem, Media $media)
 {
     $media->setTitle($importItem->title);
     $media->setDate($importItem->date);
     $media->setDescription($importItem->description);
     $media->setMediatype($importItem->mediatype);
     $media->setLength($importItem->length);
     $media->setContent($importItem->content);
     $media->setLanguage($importItem->language);
     $media->setHostName($importItem->hostName);
     $media->setHostUrl($importItem->hostUrl);
     // check if thumbnail has value as podcasts won't have one
     if (isset($importItem->thumbnail)) {
         $media->setThumbnail($importItem->thumbnail);
     }
     $media->setStatus(Media::STATUS_PENDING);
     $media->setIsImported(true);
     $this->entityManager->persist($media);
     $this->entityManager->flush();
 }