當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。