PHP 인터페이스 yii\data\DataProviderInterface

Data providers are components that sort and paginate data, and provide them to widgets such as GridView, ListView. For more details and usage information on DataProviderInterface, see the guide article on data providers.
부터: 2.0
저자: Qiang Xue ([email protected])
파일 보기 프로젝트 열기: yiisoft/yii2 0 사용 예제들

공개 메소드들

메소드 설명
getCount ( ) : integer Returns the number of data models in the current page.
getKeys ( ) : array Returns the key values associated with the data models.
getModels ( ) : array Returns the data models in the current page.
getPagination ( ) : Pagination
getSort ( ) : Sort
getTotalCount ( ) : integer Returns the total number of data models.
prepare ( boolean $forcePrepare = false ) Prepares the data models and keys.

메소드 상세

getCount() 공개 메소드

This is equivalent to count($provider->getModels()). When [[getPagination|pagination]] is false, this is the same as [[getTotalCount|totalCount]].
public getCount ( ) : integer
리턴 integer the number of data models in the current page.

getKeys() 공개 메소드

Returns the key values associated with the data models.
public getKeys ( ) : array
리턴 array the list of key values corresponding to [[getModels|models]]. Each data model in [[getModels|models]] is uniquely identified by the corresponding key value in this array.

getModels() 공개 메소드

Returns the data models in the current page.
public getModels ( ) : array
리턴 array the list of data models in the current page.

getPagination() 공개 메소드

public getPagination ( ) : Pagination
리턴 Pagination the pagination object. If this is false, it means the pagination is disabled.

getSort() 공개 메소드

public getSort ( ) : Sort
리턴 Sort the sorting object. If this is false, it means the sorting is disabled.

getTotalCount() 공개 메소드

When [[getPagination|pagination]] is false, this is the same as [[getCount|count]].
public getTotalCount ( ) : integer
리턴 integer total number of possible data models.

prepare() 공개 메소드

This method will prepare the data models and keys that can be retrieved via DataProviderInterface::getModels and DataProviderInterface::getKeys. This method will be implicitly called by DataProviderInterface::getModels and DataProviderInterface::getKeys if it has not been called before.
public prepare ( boolean $forcePrepare = false )
$forcePrepare boolean whether to force data preparation even if it has been done before.