class Sql

@todo.

Plugin annotation


@Plugin(
  id = "views_query",
  title = @Translation("SQL Query"),
  help = @Translation("Query will be generated and run using the Drupal database API.")
)

Hierarchy

Expanded class hierarchy of Sql

2 files declare their use of Sql

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php, line 30
Definition of Drupal\views\Plugin\views\query\Sql.

Namespace

Drupal\views\Plugin\views\query
View source

Members

Namesort descending Modifiers Type Description Overrides
ContainerFactoryPluginBase::create public static function Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface::create 11
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$definition public property Plugins's definition
PluginBase::$displayHandler public property The display object this plugin is for.
PluginBase::$options public property Options for this plugin will be held here.
PluginBase::$pluginDefinition protected property The plugin implementation definition.
PluginBase::$pluginId protected property The plugin_id.
PluginBase::$usesOptions protected property Denotes whether the plugin has an additional options form. 8
PluginBase::$view public property The top object of a view. 1
PluginBase::destroy public function Clears a plugin. 2
PluginBase::getAvailableGlobalTokens public function Returns an array of available token replacements.
PluginBase::getPluginDefinition public function Returns the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition
PluginBase::getPluginId public function Returns the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::globalTokenForm public function Adds elements for available core tokens to a form.
PluginBase::globalTokenReplace public function Returns a string with any core tokens replaced.
PluginBase::pluginTitle public function Return the human readable name of the display.
PluginBase::setOptionDefaults protected function Fills up the options of the plugin with defaults.
PluginBase::themeFunctions public function Provide a full list of possible theme templates used by this style. 1
PluginBase::unpackOptions public function Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away.
PluginBase::usesOptions public function Returns the usesOptions property. 8
PluginBase::validate public function Validate that the plugin is correct and can be saved. 4
PluginBase::__construct public function Constructs a Plugin object. Overrides PluginBase::__construct
QueryPluginBase::$limit protected property Stores the limit of items that should be requested in the query.
QueryPluginBase::$pager property A pager plugin that should be provided by the display.
QueryPluginBase::getLimit public function Returns the limit of the query.
QueryPluginBase::setGroupOperator public function Control how all WHERE and HAVING groups are put together.
QueryPluginBase::setLimit public function Set a LIMIT on the query, specifying a maximum number of results.
QueryPluginBase::setOffset public function Set an OFFSET on the query, specifying a number of results to skip
QueryPluginBase::setWhereGroup public function Create a new grouping for the WHERE or HAVING clause.
QueryPluginBase::summaryTitle public function Returns the summary of the settings in the display. Overrides PluginBase::summaryTitle
QueryPluginBase::validateOptionsForm public function Validate the options form. Overrides PluginBase::validateOptionsForm
Sql::$distinct property A flag as to whether or not to make the primary field distinct.
Sql::$fields property An array of fields.
Sql::$field_aliases property An array mapping table aliases and field names to field aliases.
Sql::$get_count_optimized property Should this query be optimized for counts, for example no sorts.
Sql::$groupby property A simple array of group by clauses.
Sql::$group_operator property The default operator to use when connecting the WHERE groups. May be AND or OR.
Sql::$has_aggregate property
Sql::$having property An array of sections of the HAVING query. Each section is in itself an array of pieces and a flag as to whether or not it should be AND or OR.
Sql::$no_distinct property Is the view marked as not distinct.
Sql::$orderby property A simple array of order by clauses.
Sql::$relationships property Holds an array of relationships, which are aliases of the primary table that represent different ways to join the same table in.
Sql::$tables property Holds an array of tables and counts added so that we can create aliases
Sql::$table_queue property A list of tables in the order they should be added, keyed by alias.
Sql::$tags property Query tags which will be passed over to the dbtng query object.
Sql::$where property An array of sections of the WHERE query. Each section is in itself an array of pieces and a flag as to whether or not it should be AND or OR.
Sql::addField public function Add a field to the query table, possibly with an alias. This will automatically call ensure_table to make sure the required table exists, *unless* $table is unset.
Sql::addGroupBy public function Add a simple GROUP BY clause to the query. The caller is responsible for ensuring that the fields are fully qualified and the table is properly added.
Sql::addHavingExpression public function Add a complex HAVING clause to the query. The caller is responsible for ensuring that all fields are fully qualified (TABLE.FIELD) and that the table and an appropriate GROUP BY already exist in the query. Internally the dbtng method…
Sql::addOrderBy public function Add an ORDER BY clause to the query.
Sql::addRelationship public function A relationship is an alternative endpoint to a series of table joins. Relationships must be aliases of the primary table and they must join either to the primary table or to a pre-existing relationship.
Sql::addSignature public function Add a signature to the query, if such a thing is feasible. Overrides QueryPluginBase::addSignature
Sql::addTable public function Add a table to the query, ensuring the path exists.
Sql::addTag public function Adds a query tag to the sql object.
Sql::addWhere public function Add a simple WHERE clause to the query. The caller is responsible for ensuring that all fields are fully qualified (TABLE.FIELD) and that the table already exists in the query.
Sql::add_where_expression function Add a complex WHERE clause to the query.
Sql::adjust_join function Fix a join to adhere to the proper relationship; the left table can vary based upon what relationship items are joined in on.
Sql::aggregationMethodDistinct public function
Sql::aggregationMethodSimple public function
Sql::alter function Let modules modify the query just prior to finalizing it. Overrides QueryPluginBase::alter
Sql::build function Builds the necessary info to execute the query. Overrides QueryPluginBase::build
Sql::buildCondition protected function Construct the "WHERE" or "HAVING" part of the query.
Sql::buildOptionsForm public function Add settings for the ui. Overrides PluginBase::buildOptionsForm
Sql::clearFields public function Remove all fields that may've been added; primarily used for summary mode where we're changing the query because we didn't get data we needed.
Sql::compileFields protected function Adds fields to the query.
Sql::defineOptions protected function Information about options for all kinds of purposes will be held here. @code 'option_name' => array( Overrides PluginBase::defineOptions
Sql::ensurePath protected function Make sure that the specified table can be properly linked to the primary table in the JOINs. This function uses recursion. If the tables needed to complete the path back to the primary table are not in the query they will be added, but additional…
Sql::ensure_table function Ensure a table exists in the queue; if it already exists it won't do anything, but if it doesn't it will add the table queue. It will ensure a path leads back to the relationship table.
Sql::execute function Executes the query and fills the associated view object with according values. Overrides QueryPluginBase::execute
Sql::getAggregationInfo public function Get aggregation info for group by queries. Overrides QueryPluginBase::getAggregationInfo
Sql::getDateField public function Overrides \Drupal\views\Plugin\views\query\QueryPluginBase::getDateField(). Overrides QueryPluginBase::getDateField
Sql::getDateFormat public function Overrides \Drupal\views\Plugin\views\query\QueryPluginBase::getDateFormat(). Overrides QueryPluginBase::getDateFormat
Sql::getEntityTables public function Returns an array of all tables from the query that map to an entity type.
Sql::getFieldAlias protected function Returns the alias for the given field added to $table.
Sql::getJoinData public function Retrieve join data from the larger join data cache.
Sql::getNonAggregates protected function Returns a list of non-aggregates to be added to the "group by" clause.
Sql::getTableInfo public function Get the information associated with a table.
Sql::get_where_args function Get the arguments attached to the WHERE and HAVING clauses of this query.
Sql::init public function Overrides \Drupal\views\Plugin\views\PluginBase::init(). Overrides PluginBase::init
Sql::loadEntities function Loads all entities contained in the passed-in $results. . If the entity belongs to the base table, then it gets stored in $result->_entity. Otherwise, it gets stored in $result->_relationship_entities[$relationship_id]; Overrides QueryPluginBase::loadEntities
Sql::markTable protected function
Sql::placeholder function Generates a unique placeholder used in the db query.
Sql::query public function Generate a query and a countquery from all of the information supplied to the object. Overrides QueryPluginBase::query
Sql::queueTable public function Add a table to the query without ensuring the path.
Sql::setDistinct protected function Set the view to be distinct (per base field).
Sql::setupTimezone public function Overrides \Drupal\views\Plugin\views\query\QueryPluginBase::setupTimezone(). Overrides QueryPluginBase::setupTimezone
Sql::set_count_field function Set what field the query will count() on for paging.
Sql::submitOptionsForm public function Special submit handling. Overrides QueryPluginBase::submitOptionsForm