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