ExpressionBuilder.php 741 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace yii\db;
  8. /**
  9. * Class ExpressionBuilder builds objects of [[yii\db\Expression]] class.
  10. *
  11. * @author Dmitry Naumenko <d.naumenko.a@gmail.com>
  12. * @since 2.0.14
  13. */
  14. class ExpressionBuilder implements ExpressionBuilderInterface
  15. {
  16. use ExpressionBuilderTrait;
  17. /**
  18. * {@inheritdoc}
  19. * @param Expression|ExpressionInterface $expression the expression to be built
  20. */
  21. public function build(ExpressionInterface $expression, array &$params = [])
  22. {
  23. $params = array_merge($params, $expression->params);
  24. return $expression->__toString();
  25. }
  26. }