Storage.php 991 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Templating\Storage;
  11. /**
  12. * Storage is the base class for all storage classes.
  13. *
  14. * @author Fabien Potencier <fabien@symfony.com>
  15. */
  16. abstract class Storage
  17. {
  18. protected $template;
  19. /**
  20. * Constructor.
  21. *
  22. * @param string $template The template name
  23. */
  24. public function __construct($template)
  25. {
  26. $this->template = $template;
  27. }
  28. /**
  29. * Returns the object string representation.
  30. *
  31. * @return string The template name
  32. */
  33. public function __toString()
  34. {
  35. return (string) $this->template;
  36. }
  37. /**
  38. * Returns the content of the template.
  39. *
  40. * @return string The template content
  41. */
  42. abstract public function getContent();
  43. }