Yii Framework v1.1.10 绫诲弬鑰

IDataProvider

system.web
缁ф壙 interface IDataProvider
瀛愮被 CActiveDataProvider, CArrayDataProvider, CDataProvider, CSqlDataProvider
婧愯嚜 1.1
鐗堟湰 $Id: interfaces.php 3515 2011-12-28 12:29:24Z mdomba $
婧愮爜 framework/base/interfaces.php
IDataProvider鏄暟鎹彁渚涜呯被蹇呴』瀹炵幇鐨勬帴鍙c

鏁版嵁鎻愪緵鑰呯粍浠惰兘澶熶负鎸備欢锛屽data grid锛宒ata list鎻愪緵鏁版嵁銆 闄や簡鎻愪緵鏁版嵁锛屽畠涔熸敮鎸佸垎椤典笌鎺掑簭銆

鍏叡鏂规硶

闅愯棌缁ф壙鏂规硶

鏂规硶鎻忚堪瀹氫箟鍦
getData() 杩斿洖褰撳墠鍙敤鏁版嵁椤广 IDataProvider
getId() 杩斿洖鍞竴ID鐢ㄦ潵鍖哄垎鍏跺畠鏁版嵁鎻愪緵鑰呫 IDataProvider
getItemCount() 杩斿洖褰撻〉闈㈡暟鎹」鐨勬暟閲忋 IDataProvider
getKeys() Returns the key values associated with the data items. IDataProvider
getPagination() 杩斿洖鍒嗛〉瀵硅薄銆傚鏋滀负false锛屾剰鍛崇潃绂佺敤鍒嗛〉銆 IDataProvider
getSort() 杩斿洖鎺掑簭瀵硅薄銆傚鏋滀负false锛屾剰鍛崇鐢ㄦ帓搴忋 IDataProvider
getTotalItemCount() 杩斿洖鏁版嵁椤规绘暟閲忋 IDataProvider

鏂规硶璇︾粏

getData() 鏂规硶
abstract public array getData(boolean $refresh=false)
$refresh boolean 鏄惁浠庢寔涔呭瓨鍌ㄤ腑閲嶆柊璁$畻銆
{return} array 鏁版嵁鎻愪緵鑰呬腑褰撳墠鍙敤鐨勬暟鎹」鍒楄〃銆
婧愮爜锛 framework/base/interfaces.php#591 (鏄剧ず)
public function getData($refresh=false);

杩斿洖褰撳墠鍙敤鏁版嵁椤广

getId() 鏂规硶
abstract public string getId()
{return} string 鍞竴ID鐢ㄦ潵鍖哄垎鍏跺畠鏁版嵁鎻愪緵鑰呫
婧愮爜锛 framework/base/interfaces.php#570 (鏄剧ず)
public function getId();

getItemCount() 鏂规硶
abstract public integer getItemCount(boolean $refresh=false)
$refresh boolean 鏄惁閲嶆柊璁$畻鏁版嵁椤逛腑鐨勬暟閲忋
{return} integer 褰撻〉闈㈡暟鎹」鐨勬暟閲忋
婧愮爜锛 framework/base/interfaces.php#578 (鏄剧ず)
public function getItemCount($refresh=false);

杩斿洖褰撻〉闈㈡暟鎹」鐨勬暟閲忋 杩欑浉褰撲簬count($provider->getData())銆 褰pagination璁剧疆涓篺alse锛屽畠涓totalItemCount杩斿洖鍚屾牱鐨勫笺

getKeys() 鏂规硶
abstract public array getKeys(boolean $refresh=false)
$refresh boolean 鏄惁搴旇閲嶆柊璁$畻
{return} array 閿煎搴旂殑data鍒楄〃銆 鏁扮粍涓殑姣忎竴涓敭鍞竴瀵瑰簲data涓瘡涓涓暟鎹」銆
婧愮爜锛 framework/base/interfaces.php#598 (鏄剧ず)
public function getKeys($refresh=false);

Returns the key values associated with the data items.

getPagination() 鏂规硶
abstract public CPagination getPagination()
{return} CPagination 鍒嗛〉瀵硅薄銆傚鏋滀负false锛屾剰鍛崇潃绂佺敤鍒嗛〉銆
婧愮爜锛 framework/base/interfaces.php#606 (鏄剧ず)
public function getPagination();

getSort() 鏂规硶
abstract public CSort getSort()
{return} CSort 鎺掑簭瀵硅薄銆傚鏋滀负false锛屾剰鍛崇鐢ㄦ帓搴忋
婧愮爜锛 framework/base/interfaces.php#602 (鏄剧ず)
public function getSort();

getTotalItemCount() 鏂规硶
abstract public integer getTotalItemCount(boolean $refresh=false)
$refresh boolean 鏄惁閲嶆柊璁$畻鏁版嵁椤逛腑鐨勬暟閲忋
{return} integer 鏁版嵁椤规绘暟閲忋
婧愮爜锛 framework/base/interfaces.php#585 (鏄剧ず)
public function getTotalItemCount($refresh=false);

杩斿洖鏁版嵁椤规绘暟閲忋 褰pagination璁剧疆涓篺alse锛屽畠涓itemCount杩斿洖鍚屾牱鐨勫笺

Copyright © 2008-2011 by Yii Software LLC
All Rights Reserved.