data\SqlDataProvider prepareTotalCount()

prepareTotalCount() protected method Returns a value indicating the total number of data models in this data provider. protected integer prepareTotalCount ( )return integer Total number of data models in this data provider.

data\SqlDataProvider prepareKeys()

prepareKeys() protected method Prepares the keys associated with the currently available data models. protected array prepareKeys ( $models )$models array The available data models return array The keys

data\SqlDataProvider $sql

$sql public property The SQL statement to be used for fetching data rows. public string $sql = null

data\SqlDataProvider init()

init() public method Initializes the DB connection component. This method will initialize the $db property to make sure it refers to a valid DB connection. public void init ( )throws yii\base\InvalidConfigException if $db is invalid.

data\SqlDataProvider $params

$params public property Parameters (name=>value) to be bound to the SQL statement. public array $params = []

data\SqlDataProvider prepareModels()

prepareModels() protected method Prepares the data models that will be made available in the current page. protected array prepareModels ( )return array The available data models

data\SqlDataProvider $db

$db public property The DB connection object or the application component ID of the DB connection. Starting from version 2.0.2, this can also be a configuration array for creating the object. public yii\db\Connection|array|string $db = 'db'

data\SqlDataProvider $key

$key public property The column that is used as the key of the data models. This can be either a column name, or a callable that returns the key value of a given data model. If this is not set, the keys of the $models array will be used. public string|callable $key = null

data\Sort setAttributeOrders()

setAttributeOrders() public method (available since version 2.0.10) Sets up the currently sort information. public void setAttributeOrders ( $attributeOrders, $validate = true )$attributeOrders array|null Sort directions indexed by attribute names. Sort direction can be either SORT_ASC for ascending order or SORT_DESC for descending order. $validate boolean Whether to validate given attribute orders against $attributes and $enableMultiSort. If validation is enabled incorrect entries

data\Sort link()

link() public method Generates a hyperlink that links to the sort action to sort by the specified attribute. Based on the sort direction, the CSS class of the generated hyperlink will be appended with "asc" or "desc". public string link ( $attribute, $options = [] )$attribute string The attribute name by which the data should be sorted by. $options array Additional HTML attributes for the hyperlink tag. There is one special attribute label which will be used as the label of the hyperli