BaseFactory.php 1006B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace Muzich\CoreBundle\ElementFactory\Site\base;
  3. use Muzich\CoreBundle\Entity\Element;
  4. use Symfony\Component\DependencyInjection\Container;
  5. use \Exception;
  6. /**
  7. *
  8. * @author bux
  9. */
  10. class BaseFactory implements FactoryInterface
  11. {
  12. protected $element;
  13. protected $container;
  14. /**
  15. *
  16. * @param Element $element
  17. * @param Container $container
  18. */
  19. public function __construct(Element $element, Container $container)
  20. {
  21. $this->element = $element;
  22. $this->container = $container;
  23. }
  24. public function getEmbedCode()
  25. {
  26. return null;
  27. }
  28. /**
  29. * Retourne l'url relative dans le site
  30. *
  31. * @return string
  32. */
  33. protected function getCleanedUrl()
  34. {
  35. $url = str_replace('www.', '', $this->element->getUrl());
  36. $url = str_replace('http://'.$this->element->getType(), '', $url);
  37. $url = str_replace('https://'.$this->element->getType(), '', $url);
  38. return $url;
  39. }
  40. public function getThumbnailUrl()
  41. {
  42. return null;
  43. }
  44. }
  45. ?>