本文整理汇总了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());
}
}
示例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;
}
示例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);
}
}
示例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;
}