SqlParser\Components\Expression::__construct PHP Метод

__construct() публичный Метод

Syntax: new Expression('expr') new Expression('expr', 'alias') new Expression('database', 'table', 'column') new Expression('database', 'table', 'column', 'alias') If the database, table or column name is not required, pass an empty string.
public __construct ( string $database = null, string $table = null, string $column = null, string $alias = null )
$database string The name of the database or the the expression. the the expression.
$table string The name of the table or the alias of the expression. the alias of the expression.
$column string The name of the column.
$alias string The name of the alias.
    public function __construct($database = null, $table = null, $column = null, $alias = null)
    {
        if ($column === null && $alias === null) {
            $this->expr = $database;
            // case 1
            $this->alias = $table;
            // case 2
        } else {
            $this->database = $database;
            // case 3
            $this->table = $table;
            // case 3
            $this->column = $column;
            // case 3
            $this->alias = $alias;
            // case 4
        }
    }