本文整理汇总了PHP中ModelAdmin::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP ModelAdmin::getList方法的具体用法?PHP ModelAdmin::getList怎么用?PHP ModelAdmin::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelAdmin
的用法示例。
在下文中一共展示了ModelAdmin::getList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getList
public function getList()
{
if (Permission::check('ADMIN')) {
return parent::getList();
}
return parent::getList()->filter(array('Approved' => false));
}
示例2: getList
public function getList()
{
$list = parent::getList();
if ($this->modelClass == 'PostmarkMessage') {
$list = $list->filter('InReplyToID', 0)->sort('LastEdited DESC');
}
return $list;
}
示例3: getList
public function getList()
{
$list = parent::getList();
if ($this->modelClass == 'Presentation' || $this->modelClass == 'PresentationSpeaker') {
$list = $list->sort('Created', 'DESC');
}
return $list;
}
示例4: getList
public function getList()
{
$list = parent::getList();
if ($this->modelClass === 'SurveyTemplate') {
$list = $list->filter(array('ClassName' => 'SurveyTemplate'));
}
return $list;
}
示例5: getList
public function getList()
{
$list = parent::getList();
if ($this->IsEditingNews()) {
$list = $list->sort('DateTime DESC')->filter('ClassName', $this->getSearchableClasses());
}
$this->extend('updateNewsList', $list);
return $list;
}
示例6: getList
public function getList()
{
$list = parent::getList();
// Filter categories
if ($this->modelClass == 'Category') {
$list = $list->filter('ParentID', 0);
}
$this->extend('updateList', $list);
return $list;
}
示例7: getList
public function getList()
{
$list = parent::getList();
// Ensure that we only show Order objects in the order tab
if ($this->modelClass == "Order") {
$list = $list->addFilter(array("ClassName" => "Order"));
}
$this->extend("updateList", $list);
return $list;
}
示例8: getList
public function getList()
{
$list = parent::getList();
// use this to access search parameters
$params = $this->request->requestVar('q');
if ($this->modelClass == 'Contact' && isset($params['Flagged']) && $params['Flagged']) {
$list = $list->filter("Notes.Flag", true);
}
return $list;
}
示例9: getList
public function getList()
{
$list = parent::getList();
$params = $this->request->requestVar('q');
// use this to access search parameters
if ($this->modelClass == 'Payment' && empty($params)) {
$list = $list->exclude('AmountAmount', '0');
}
return $list;
}
示例10: getList
/**
* List only newsitems from current subsite.
*
* @author Marcio Barrientos
* @return ArrayList $list
*/
public function getList()
{
/** @var DataList $list */
$list = parent::getList();
if ($this->modelClass === 'News' && class_exists('Subsite') && Subsite::currentSubsiteID() > 0) {
$pages = NewsHolderPage::get()->filter(array('SubsiteID' => (int) Subsite::currentSubsiteID()));
$filter = $pages->column('ID');
/* Manual join needed because otherwise no items are found. Unknown why. */
$list = $list->innerJoin('NewsHolderPage_Newsitems', 'NewsHolderPage_Newsitems.NewsID = News.ID')->filter(array('NewsHolderPage_Newsitems.NewsHolderPageID' => $filter));
}
return $list;
}
示例11: getList
public function getList()
{
$list = parent::getList();
// Filter categories
if ($this->modelClass == 'ProductCategory') {
$parentID = $this->request->requestVar('ParentID');
if (!$parentID) {
$parentID = 0;
}
$list = $list->filter('ParentID', $parentID);
}
return $list;
}
示例12: getList
/**
* Restrict list to non-hidden statuses
*/
public function getList()
{
if ($this->modelClass == "Order") {
$context = $this->getSearchContext();
$params = $this->request->requestVar('q');
//TODO update params DateTo, to include the day, ie 23:59:59
$list = $context->getResults($params)->exclude("Status", Order::config()->hidden_status);
//exclude hidden statuses
$this->extend('updateList', $list);
return $list;
} else {
return parent::getList();
}
}
示例13: getList
public function getList()
{
$list = parent::getList();
if ($this->modelClass == 'Subscription') {
$list = $list->exclude('Member.ID', null);
}
if ($this->modelClass == 'CreditCard') {
$list = $list->exclude('Member.ID', null);
}
if ($this->modelClass == 'Heatmaps') {
$list = $list->exclude('Member.ID', null);
}
if ($this->modelClass == 'Order') {
$list = $list->exclude('Member.ID', null);
}
return $list;
}
示例14: getList
/**
* Custom filtering on "Status"
* @return Form
**/
public function getList()
{
$list = parent::getList();
$r = $this->getRequest();
if ($q = $r->requestVar('q')) {
if (isset($q['Status'])) {
$status = $q['Status'];
$now = date('Y-m-d H:i:s');
if ($status == 'Future') {
return $list->where("StartTime > '{$now}'");
} elseif ($status == 'Past') {
return $list->where("EndTime < {$now}");
} elseif ($status == 'Current') {
return $list->where("\n\t\t\t\t\t\tStartTime < '{$now}' AND \n\t\t\t\t\t\t(EndTime > '{$now}' OR EndTime IS NULL) \n\t\t\t\t\t");
}
}
}
return $list;
}
示例15: getList
public function getList()
{
$list = parent::getList();
return $list;
}