当前位置: 首页>>代码示例>>PHP>>正文


PHP DataObjectSet::remove方法代码示例

本文整理汇总了PHP中DataObjectSet::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP DataObjectSet::remove方法的具体用法?PHP DataObjectSet::remove怎么用?PHP DataObjectSet::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataObjectSet的用法示例。


在下文中一共展示了DataObjectSet::remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getContextNav

	function getContextNav() {
		if($this->ID > 0) {
			$pages = new DataObjectSet();
			$pages->push($this->Parent());
			$pages->merge($this->getPagesBySibling());
			$pages->merge($this->getPagesByKeyword());
			$pages->merge($this->getPagesByBlogTags());
			$pages->merge($this->getPagesByReferer());
			$pages->removeDuplicates();
			$currentPage = $pages->find('ID', $this->ID);
			if($currentPage) $pages->remove($currentPage);
			return $pages;
		} else {
			return false;
		}
	}
开发者ID:neopba,项目名称:silverstripe-book,代码行数:16,代码来源:Page.php

示例2: get_by_publisher

 public static function get_by_publisher($class, $publisher, $status = null)
 {
     // To ensure 2.3 and 2.4 compatibility
     $bt = defined('DB::USE_ANSI_SQL') ? "\"" : "`";
     if ($status) {
         $statusStr = "'" . implode("','", $status) . "'";
     }
     $classes = (array) ClassInfo::subclassesFor($class);
     $classesSQL = implode("','", $classes);
     // build filter
     $filter = "{$bt}WorkflowRequest{$bt}.{$bt}ClassName{$bt} IN ('{$classesSQL}') ";
     if ($status) {
         $filter .= "AND {$bt}WorkflowRequest{$bt}.{$bt}Status{$bt} IN (" . $statusStr . ")";
     }
     $onDraft = Versioned::get_by_stage("SiteTree", "Stage", $filter, "{$bt}SiteTree{$bt}.{$bt}LastEdited{$bt} DESC", "LEFT JOIN {$bt}WorkflowRequest{$bt} ON {$bt}WorkflowRequest{$bt}.{$bt}PageID{$bt} = {$bt}SiteTree{$bt}.{$bt}ID{$bt} ");
     $onLive = Versioned::get_by_stage("SiteTree", "Live", $filter, "{$bt}SiteTree_Live{$bt}.{$bt}LastEdited{$bt} DESC", "LEFT JOIN {$bt}WorkflowRequest{$bt} ON {$bt}WorkflowRequest{$bt}.{$bt}PageID{$bt} = {$bt}SiteTree_Live{$bt}.{$bt}ID{$bt} ");
     $return = new DataObjectSet();
     $return->merge($onDraft);
     $return->merge($onLive);
     $return->removeDuplicates();
     $canPublish = SiteTree::batch_permission_check($return->column('ID'), $publisher->ID, 'CanPublishType', 'SiteTree_PublisherGroups', 'canPublish');
     foreach ($return as $page) {
         if (!isset($canPublish[$page->ID]) || !$canPublish[$page->ID]) {
             $return->remove($page);
         }
     }
     return $return;
 }
开发者ID:helpfulrobot,项目名称:silverstripe-cmsworkflow,代码行数:28,代码来源:WorkflowThreeStepRequest.php


注:本文中的DataObjectSet::remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。