PdoValueBuilder.php 692 B

1234567891011121314151617181920212223242526272829303132
  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 PdoValueBuilder builds object of the [[PdoValue]] expression class.
  10. *
  11. * @author Dmytro Naumenko <d.naumenko.a@gmail.com>
  12. * @since 2.0.14
  13. */
  14. class PdoValueBuilder implements ExpressionBuilderInterface
  15. {
  16. const PARAM_PREFIX = ':pv';
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public function build(ExpressionInterface $expression, array &$params = [])
  21. {
  22. $placeholder = static::PARAM_PREFIX . count($params);
  23. $params[$placeholder] = $expression;
  24. return $placeholder;
  25. }
  26. }