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


PHP Subsite::get_from_all_subsites方法代码示例

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


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

示例1: sourceRecords

 /**
  * Returns an array with 2 elements, one with a list of Page on the site (and all subsites if
  * applicable) and another with files.
  *
  * @return array
  */
 public function sourceRecords()
 {
     if (class_exists('Subsite') && Subsite::get()->count() > 0) {
         $origMode = Versioned::get_reading_mode();
         Versioned::set_reading_mode('Stage.Stage');
         $items = array('Pages' => Subsite::get_from_all_subsites('SiteTree'), 'Files' => Subsite::get_from_all_subsites('File'));
         Versioned::set_reading_mode($origMode);
         return $items;
     } else {
         return array('Pages' => Versioned::get_by_stage('SiteTree', 'Stage'), 'Files' => File::get());
     }
 }
开发者ID:silverstripe,项目名称:sitewidecontent-report,代码行数:18,代码来源:SitewideContentReport.php

示例2: parameterFields

 public function parameterFields()
 {
     $fields = new FieldList();
     if (class_exists("Subsite")) {
         $first_order = Subsite::get_from_all_subsites("Order")->sort('Created', 'ASC')->first();
     } else {
         $first_order = Order::get()->sort('Created', 'ASC')->first();
     }
     // Check if any order exist
     if ($first_order) {
         // List all months
         $months = array('All');
         for ($i = 1; $i <= 12; $i++) {
             $months[] = date("F", mktime(0, 0, 0, $i + 1, 0, 0));
         }
         // Get the first order, then count down from current year to that
         $firstyear = new SS_Datetime('FirstDate');
         $firstyear->setValue($first_order->Created);
         $years = array();
         for ($i = date('Y'); $i >= $firstyear->Year(); $i--) {
             $years[$i] = $i;
         }
         // Order Status
         $statuses = Order::config()->statuses;
         array_unshift($statuses, 'All');
         $fields->push(TextField::create('Filter_FirstName', 'Customer First Name'));
         $fields->push(TextField::create('Filter_Surname', 'Customer Surname'));
         $fields->push(TextField::create('Filter_StockID', 'Stock ID'));
         $fields->push(TextField::create('Filter_ProductName', 'Product Name'));
         $fields->push(DropdownField::create('Filter_Month', 'Month', $months));
         $fields->push(DropdownField::create('Filter_Year', 'Year', $years));
         $fields->push(DropdownField::create('Filter_Status', 'Order Status', $statuses));
     }
     return $fields;
 }
开发者ID:i-lateral,项目名称:silverstripe-orders,代码行数:35,代码来源:OrderItemReport.php

示例3: VirtualPages

 /**
  * Return all virtual pages that link to this page
  */
 function VirtualPages()
 {
     if (!$this->ID) {
         return null;
     }
     if (class_exists('Subsite')) {
         return Subsite::get_from_all_subsites('VirtualPage', "\"CopyContentFromID\" = " . (int) $this->ID);
     } else {
         return DataObject::get('VirtualPage', "\"CopyContentFromID\" = " . (int) $this->ID);
     }
 }
开发者ID:eLBirador,项目名称:AllAboutCity,代码行数:14,代码来源:SiteTree.php

示例4: VirtualPages

 /**
  * Return all virtual pages that link to this page.
  *
  * @return DataList
  */
 public function VirtualPages()
 {
     // Ignore new records
     if (!$this->ID) {
         return null;
     }
     // Check subsite virtual pages
     // @todo Refactor out subsite module specific code
     if (class_exists('Subsite')) {
         return Subsite::get_from_all_subsites('VirtualPage', array('"VirtualPage"."CopyContentFromID"' => $this->ID));
     }
     // Check existing virtualpages
     if (class_exists('VirtualPage')) {
         return VirtualPage::get()->where(array('"VirtualPage"."CopyContentFromID"' => $this->ID));
     }
     return null;
 }
开发者ID:riddler7,项目名称:silverstripe-cms,代码行数:22,代码来源:SiteTree.php


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