phprs\ezsql\impls\FromImpl::from PHP Method

from() public static method

public static from ( $context, $tables, $as = null )
    public static function from($context, $tables, $as = null)
    {
        if ($tables instanceof BasicRule) {
            $context->appendSql("FROM (" . $tables->context->sql . ')');
            $context->params = array_merge($context->params, $tables->context->params);
        } else {
            $context->appendSql("FROM {$tables}");
        }
        if ($as) {
            $context->appendSql("as {$as}");
        }
    }

Usage Example

Example #1
0
 /**
  * from('table') => "FROM table"
  * @param string $table
  * @return \phprs\ezsql\rules\select\JoinRule
  */
 public function from($table, $as = null)
 {
     FromImpl::from($this->context, $table, $as);
     return new JoinRule($this->context);
 }
FromImpl