本文整理汇总了PHP中repository::create方法的典型用法代码示例。如果您正苦于以下问题:PHP repository::create方法的具体用法?PHP repository::create怎么用?PHP repository::create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类repository
的用法示例。
在下文中一共展示了repository::create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* Create an instance for this plug-in
*
* @static
* @param string $type the type of the repository
* @param int $userid the user id
* @param stdClass $context the context
* @param array $params the options for this instance
* @param int $readonly whether to create it readonly or not (defaults to not)
* @return mixed
*/
public static function create($type, $userid, $context, $params, $readonly = 0)
{
if (has_capability('moodle/site:config', context_system::instance())) {
return parent::create($type, $userid, $context, $params, $readonly);
} else {
require_capability('moodle/site:config', context_system::instance());
return false;
}
}
示例2: create
public static function create($type, $userid, $context, $params, $readonly = 0)
{
global $PAGE;
if (has_capability('moodle/site:config', get_system_context())) {
return parent::create($type, $userid, $context, $params, $readonly);
} else {
require_capability('moodle/site:config', get_system_context());
return false;
}
}
示例3: create
/**
* @param Request $request
* @return mixed
*/
public function create(Request $request)
{
$repository = $this->repository->create($request->all());
return Response::json(['sucesso' => ['message' => 'Coméntario CRIADO com sucesso', 'data' => $repository]], 200);
}