本文整理匯總了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);
}
}
示例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);
}
示例3: addCategory
public function addCategory(\TaskBundle\Entity\Category $category)
{
$this->categories->add($category);
}
示例4: addLayoutAssigned
/**
* Set layoutsAssigned
*
* @param \stdClass $layoutsAssigned
* @return LayoutCustomer
*/
public function addLayoutAssigned($layoutsAssigned)
{
$this->layoutsAssigned->add($layoutsAssigned);
return $this;
}
示例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)));
}