Yoast\WP\Lib
ORM::add_result_column() protected Yoast 1.0
Adds an unquoted expression to the set of columns returned by the SELECT query. Internal method.
{} Это метод класса: ORM{}
Хуков нет.
Возвращает
ORM.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->add_result_column( $expr, $alias );
- $expr(строка) (обязательный)
- The expression.
- $alias(null/строка)
- The alias to return the expression as.
По умолчанию: null
Код ORM::add_result_column() ORM::add result column Yoast 15.6.2
protected function add_result_column( $expr, $alias = null ) {
if ( ! \is_null( $alias ) ) {
$expr .= ' AS ' . $this->quote_identifier( $alias );
}
if ( $this->using_default_result_columns ) {
$this->result_columns = [ $expr ];
$this->using_default_result_columns = false;
}
else {
$this->result_columns[] = $expr;
}
return $this;
}