* ActiveDataProvider implements a data provider based on [[Query]] and [[ActiveQuery]].
* ActiveDataProvider implements a data provider based on [[Query]] and [[ActiveQuery]].
...
@@ -54,7 +54,7 @@ use yii\db\Connection;
...
@@ -54,7 +54,7 @@ use yii\db\Connection;
classActiveDataProviderextendsBaseDataProvider
classActiveDataProviderextendsBaseDataProvider
{
{
/**
/**
* @var Query the query that is used to fetch data models and [[totalCount]]
* @var QueryInterface the query that is used to fetch data models and [[totalCount]]
* if it is not explicitly set.
* if it is not explicitly set.
*/
*/
public$query;
public$query;
...
@@ -97,8 +97,8 @@ class ActiveDataProvider extends BaseDataProvider
...
@@ -97,8 +97,8 @@ class ActiveDataProvider extends BaseDataProvider
*/
*/
protectedfunctionprepareModels()
protectedfunctionprepareModels()
{
{
if(!$this->queryinstanceofQuery){
if(!$this->queryinstanceofQueryInterface){
thrownewInvalidConfigException('The "query" property must be an instance of Query or its subclass.');
thrownewInvalidConfigException('The "query" property must be an instance of a class that implements the QueryInterface e.g. yii\db\Query or its subclasses.');
}
}
if(($pagination=$this->getPagination())!==false){
if(($pagination=$this->getPagination())!==false){
$pagination->totalCount=$this->getTotalCount();
$pagination->totalCount=$this->getTotalCount();
...
@@ -125,7 +125,7 @@ class ActiveDataProvider extends BaseDataProvider
...
@@ -125,7 +125,7 @@ class ActiveDataProvider extends BaseDataProvider
@@ -154,11 +154,11 @@ class ActiveDataProvider extends BaseDataProvider
...
@@ -154,11 +154,11 @@ class ActiveDataProvider extends BaseDataProvider
*/
*/
protectedfunctionprepareTotalCount()
protectedfunctionprepareTotalCount()
{
{
if(!$this->queryinstanceofQuery){
if(!$this->queryinstanceofQueryInterface){
thrownewInvalidConfigException('The "query" property must be an instance of Query or its subclass.');
thrownewInvalidConfigException('The "query" property must be an instance of a class that implements the QueryInterface e.g. yii\db\Query or its subclasses.');