/**
  * Constructor. Takes a name for the function to be invoked and a list of params
  * to be passed into the function. Optionally you can pass a list of types to
  * be used for each bound param.
  *
  * By default, all params that are passed will be quoted. If you wish to use
  * literal arguments, you need to explicitly hint this function.
  *
  * ### Examples:
  *
  *  ``$f = new FunctionExpression('CONCAT', ['CakePHP', ' rules']);``
  *
  * Previous line will generate ``CONCAT('CakePHP', ' rules')``
  *
  * ``$f = new FunctionExpression('CONCAT', ['name' => 'literal', ' rules']);``
  *
  * Will produce ``CONCAT(name, ' rules')``
  *
  * @param string $name the name of the function to be constructed
  * @param array $params list of arguments to be passed to the function
  * If associative the key would be used as argument when value is 'literal'
  * @param array $types associative array of types to be associated with the
  * passed arguments
  */
 public function __construct($name, $params = [], $types = [])
 {
     $this->_name = $name;
     parent::__construct($params, $types, ',');
 }
 /**
  * Constructor. Takes a name for the function to be invoked and a list of params
  * to be passed into the function. Optionally you can pass a list of types to
  * be used for each bound param.
  *
  * By default, all params that are passed will be quoted. If you wish to use
  * literal arguments, you need to explicitly hint this function.
  *
  * ### Examples:
  *
  *  `$f = new FunctionExpression('CONCAT', ['CakePHP', ' rules']);`
  *
  * Previous line will generate `CONCAT('CakePHP', ' rules')`
  *
  * `$f = new FunctionExpression('CONCAT', ['name' => 'literal', ' rules']);`
  *
  * Will produce `CONCAT(name, ' rules')`
  *
  * @param string $name the name of the function to be constructed
  * @param array $params list of arguments to be passed to the function
  * If associative the key would be used as argument when value is 'literal'
  * @param array $types associative array of types to be associated with the
  * passed arguments
  * @param string $returnType The return type of this expression
  */
 public function __construct($name, $params = [], $types = [], $returnType = 'string')
 {
     $this->_name = $name;
     $this->_returnType = $returnType;
     parent::__construct($params, $types, ',');
 }
Exemple #3
0
 /**
  * Constructor
  *
  * @param array $conditions The sort columns
  * @param array $types The types for each column.
  * @param string $conjunction The glue used to join conditions together.
  */
 public function __construct($conditions = [], $types = [], $conjunction = '')
 {
     parent::__construct($conditions, $types, $conjunction);
 }