ExpressionInterface.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * PHP Version 5.4
  4. *
  5. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  6. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  7. *
  8. * Licensed under The MIT License
  9. * For full copyright and license information, please see the LICENSE.txt
  10. * Redistributions of files must retain the above copyright notice.
  11. *
  12. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  13. * @link http://cakephp.org CakePHP(tm) Project
  14. * @since CakePHP(tm) v 3.0.0
  15. * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
  16. */
  17. namespace Cake\Database;
  18. /**
  19. * An interface used by Expression objects.
  20. */
  21. interface ExpressionInterface {
  22. /**
  23. * Converts the Node into a SQL string fragment.
  24. *
  25. * @param Cake\Database\ValueBinder $generator Placeholder generator object
  26. * @return string
  27. */
  28. public function sql(ValueBinder $generator);
  29. /**
  30. * Iterates over each part of the expression recursively for every
  31. * level of the expressions tree and executes the $visitor callable
  32. * passing as first parameter the instance of the expression currently
  33. * being iterated.
  34. *
  35. * @param callable $visitor
  36. * @return void
  37. */
  38. public function traverse(callable $visitor);
  39. }