當前位置: 首頁>>代碼示例>>PHP>>正文


PHP stdClass::add方法代碼示例

本文整理匯總了PHP中stdClass::add方法的典型用法代碼示例。如果您正苦於以下問題:PHP stdClass::add方法的具體用法?PHP stdClass::add怎麽用?PHP stdClass::add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在stdClass的用法示例。


在下文中一共展示了stdClass::add方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: add_course_navigation

 /**
  * Sets up navigation entries.
  *
  * @param stdClass $instancesnode
  * @param stdClass $instance
  * @return void
  */
 public function add_course_navigation($instancesnode, stdClass $instance)
 {
     if ($instance->enrol !== 'auto') {
         throw new coding_exception('Invalid enrol instance type!');
     }
     $context = context_course::instance($instance->courseid);
     if (has_capability('enrol/auto:config', $context)) {
         $managelink = new moodle_url('/enrol/auto/edit.php', array('courseid' => $instance->courseid, 'id' => $instance->id));
         $instancesnode->add($this->get_instance_name($instance), $managelink, navigation_node::TYPE_SETTING);
     }
 }
開發者ID:ninelanterns,項目名稱:scaffold-enrol_auto,代碼行數:18,代碼來源:lib.php

示例2: getBarService

 /**
  * Gets the 'bar' service.
  *
  * This service is shared.
  * This method always returns the same instance of the service.
  *
  * @return \stdClass A stdClass instance
  */
 protected function getBarService()
 {
     $a = new \stdClass();
     $a->add($this);
     return $this->services['bar'] = new \stdClass($a);
 }
開發者ID:joelwurtz,項目名稱:symfony,代碼行數:14,代碼來源:services13.php

示例3: addCategory

 public function addCategory(\TaskBundle\Entity\Category $category)
 {
     $this->categories->add($category);
 }
開發者ID:kuusas,項目名稱:symfony-example-project,代碼行數:4,代碼來源:Task.php

示例4: addLayoutAssigned

 /**
  * Set layoutsAssigned
  *
  * @param  \stdClass      $layoutsAssigned
  * @return LayoutCustomer
  */
 public function addLayoutAssigned($layoutsAssigned)
 {
     $this->layoutsAssigned->add($layoutsAssigned);
     return $this;
 }
開發者ID:thierrymarianne,項目名稱:MttBundle,代碼行數:11,代碼來源:LayoutCustomer.php

示例5: pcast_extend_navigation

/**
 * Adds module specific settings to the navigation block
 * @global stdClass $CFG
 * @param stdClass $navigation
 * @param stdClass $course
 * @param stdClass $module
 * @param stdClass $cm
 */
function pcast_extend_navigation($navigation, $course, $module, $cm)
{
    global $CFG;
    $navigation->add(get_string('standardview', 'pcast'), new moodle_url('/mod/pcast/view.php', array('id' => $cm->id, 'mode' => PCAST_STANDARD_VIEW)));
    $navigation->add(get_string('categoryview', 'pcast'), new moodle_url('/mod/pcast/view.php', array('id' => $cm->id, 'mode' => PCAST_CATEGORY_VIEW)));
    $navigation->add(get_string('dateview', 'pcast'), new moodle_url('/mod/pcast/view.php', array('id' => $cm->id, 'mode' => PCAST_DATE_VIEW)));
    $navigation->add(get_string('authorview', 'pcast'), new moodle_url('/mod/pcast/view.php', array('id' => $cm->id, 'mode' => PCAST_AUTHOR_VIEW)));
}
開發者ID:rtsfc,項目名稱:moodle-mod_pcast,代碼行數:16,代碼來源:lib.php


注:本文中的stdClass::add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。