Youtube.php 589B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Muzich\CoreBundle\Factory\Elements;
  3. use Muzich\CoreBundle\Factory\Elements\Youtubecom;
  4. use Muzich\CoreBundle\Entity\Element;
  5. /**
  6. *
  7. *
  8. * @author bux
  9. */
  10. class Youtube extends Youtubecom
  11. {
  12. public function retrieveDatas()
  13. {
  14. $url_clean = $this->getCleanedUrl();
  15. $ref_id = null;
  16. if (preg_match("#\/([a-zA-Z0-9_]+)#", $url_clean, $chaines))
  17. {
  18. $ref_id = $chaines[1];
  19. }
  20. $this->element->setData(Element::DATA_REF_ID, $ref_id);
  21. // Données API
  22. if ($ref_id)
  23. {
  24. $this->proceedAPIDatas($ref_id);
  25. }
  26. }
  27. }