SerializedParsedExpression.php 842 B

12345678910111213141516171819202122232425262728293031323334353637
  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\ExpressionLanguage;
  11. /**
  12. * Represents an already parsed expression.
  13. *
  14. * @author Fabien Potencier <fabien@symfony.com>
  15. */
  16. class SerializedParsedExpression extends ParsedExpression
  17. {
  18. private $nodes;
  19. /**
  20. * @param string $expression An expression
  21. * @param string $nodes The serialized nodes for the expression
  22. */
  23. public function __construct($expression, $nodes)
  24. {
  25. $this->expression = (string) $expression;
  26. $this->nodes = $nodes;
  27. }
  28. public function getNodes()
  29. {
  30. return unserialize($this->nodes);
  31. }
  32. }