webCOMAND

expression::__construct()

The expression constructor creates a new expression object from operations.

Prototype

expression expression(mixed $ops, array $options = [])

Parameters

  • $ops - An query expression in string or expression array format.
  • $options (optional) - Associative array of options to override defaults.
use comand\repository\expression;

require_once( 'comand.php' );

$repo = comand::repo();
$exp = new expression(['+',1,2]);

// create query with expression
$query = $repo->query->select(['AS',$exp,'Sum']);