/** * Validate that the given column is a valid statement column and return it or the actual name if it's an alias * * @param string $table The table for which to require the column * @param string $name The name or alias of the column to validate * * @return string The given column's name * * @throws StatementException In case the given column is not a statement column */ public function requireStatementColumn($table, $name) { if (($column = $this->resolveStatementColumnAlias($table, $name)) !== null) { $alias = $name; } elseif (($alias = $this->reassembleStatementColumnAlias($table, $name)) !== null) { $column = $name; } else { return parent::requireStatementColumn($table, $name); } if (!$this->validateStatementColumnAssociation($table, $alias)) { throw new StatementException('Statement column "%s" not found in table "%s"', $name, $table); } return $column; }