当前位置: 首页>>代码示例>>PHP>>正文


PHP base::validate_data方法代码示例

本文整理汇总了PHP中core\event\base::validate_data方法的典型用法代码示例。如果您正苦于以下问题:PHP base::validate_data方法的具体用法?PHP base::validate_data怎么用?PHP base::validate_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core\event\base的用法示例。


在下文中一共展示了base::validate_data方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     if (!isset($this->other['subscriptionid'])) {
         throw new \coding_exception('The \'subscriptionid\' value must be set in other.');
     }
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:13,代码来源:subscription_criteria_met.php

示例2: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception
  */
 protected function validate_data()
 {
     parent::validate_data();
     if ($this->contextlevel != CONTEXT_MODULE) {
         throw new \coding_exception('Context level must be CONTEXT_MODULE.');
     }
 }
开发者ID:ninelanterns,项目名称:moodle-mod_scheduler,代码行数:12,代码来源:scheduler_base.php

示例3: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     if (!isset($this->other['itemid'])) {
         throw new \coding_exception('The itemid needs to be set in $other');
     }
 }
开发者ID:parksandwildlife,项目名称:learning,代码行数:13,代码来源:rating_created.php

示例4: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     if (!isset($this->relateduserid)) {
         throw new \coding_exception('The \'relateduserid\' must be set.');
     }
 }
开发者ID:advancingdesign,项目名称:moodle-local_enrolmentreminder,代码行数:13,代码来源:message_sent.php

示例5: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     if (!isset($this->other['title'])) {
         throw new \coding_exception('The \'title\' value must be set in the object.');
     }
 }
开发者ID:unikent,项目名称:moodle-mod_qa,代码行数:13,代码来源:question_posted.php

示例6: validate_data

 /**
  * Custom validations.
  *
  * @throws \coding_exception when validation fails.
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     // Make sure this class is never used without proper object details.
     if (!$this->contextlevel === CONTEXT_MODULE) {
         throw new \coding_exception('Context level must be CONTEXT_MODULE.');
     }
 }
开发者ID:evltuma,项目名称:moodle,代码行数:14,代码来源:content_page_viewed.php

示例7: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     if (!isset($this->relateduserid)) {
         debugging('The \'relateduserid\' value must be specified in the event.', DEBUG_DEVELOPER);
         $this->relateduserid = $this->objectid;
     }
 }
开发者ID:sebastianberm,项目名称:moodle-block_coupon,代码行数:14,代码来源:coupon_used.php

示例8: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     if (empty($this->other['mode'])) {
         throw new \coding_exception('The \'mode\' value must be set in other.');
     }
     if (empty($this->relateduserid)) {
         throw new \coding_exception('The \'relateduserid\' must be set.');
     }
 }
开发者ID:posttechguy,项目名称:moodle-tbst2-report_log,代码行数:16,代码来源:user_report_viewed.php

示例9: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     if (!isset($this->other['desc'])) {
         throw new \coding_exception('The \'desc\' value must be set in other.');
     }
     if ($this->contextlevel != CONTEXT_MODULE) {
         throw new \coding_exception('Context level must be CONTEXT_MODULE.');
     }
 }
开发者ID:ccle,项目名称:moodle-mod_turnitintool,代码行数:16,代码来源:delete_submission.php

示例10: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception when validation does not pass.
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     if (!isset($this->other['dataid'])) {
         throw new \coding_exception('The dataid must be set in $other.');
     }
     if (!isset($this->other['viewid'])) {
         throw new \coding_exception('The viewid must be set in $other.');
     }
 }
开发者ID:parksandwildlife,项目名称:learning,代码行数:16,代码来源:view_base.php

示例11: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     // Make sure this class is never used without proper object details.
     if (empty($this->objectid) || empty($this->objecttable)) {
         throw new \coding_exception('The course_module_viewed event must define objectid and object table.');
     }
     // Make sure the context level is set to module.
     if ($this->contextlevel != CONTEXT_MODULE) {
         throw new \coding_exception('Context level must be CONTEXT_MODULE.');
     }
 }
开发者ID:evltuma,项目名称:moodle,代码行数:18,代码来源:all_files_downloaded.php

示例12: validate_data

 protected function validate_data()
 {
     parent::validate_data();
     if (!isset($this->userid)) {
         throw new \coding_exception('The user id must be set.');
     }
     if (!isset($this->courseid)) {
         throw new \coding_exception('The course id must be set.');
     }
     if (!isset($this->other['quizcmid']) && !isset($this->other['qcatid'])) {
         throw new \coding_exception('Either the quiz course module id or the question category id must be set.');
     }
 }
开发者ID:MoodleMetaData,项目名称:MoodleMetaData,代码行数:13,代码来源:questions_retrieved.php

示例13: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     if (!isset($this->other['tourid'])) {
         throw new \coding_exception('The \'tourid\' value must be set in other.');
     }
     if (!isset($this->other['stepindex'])) {
         throw new \coding_exception('The \'stepindex\' value must be set in other.');
     }
     if (!isset($this->other['pageurl'])) {
         throw new \coding_exception('The \'pageurl\' value must be set in other.');
     }
 }
开发者ID:dg711,项目名称:moodle,代码行数:19,代码来源:step_shown.php

示例14: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     if (empty($this->other['attemptid'])) {
         throw new \coding_exception("The 'attemptid' must be set in other.");
     }
     if (empty($this->other['cmielement'])) {
         throw new \coding_exception("The 'cmielement' must be set in other.");
     }
     // Trust that 'cmielement' represents a valid CMI datamodel element:
     // just check that the given value starts with 'cmi.'.
     if (strpos($this->other['cmielement'], 'cmi.', 0) !== 0) {
         throw new \coding_exception("A valid 'cmielement' must start with 'cmi.' ({$this->other['cmielement']}).");
     }
     // Warning: 'cmivalue' could be also "0" e.g. when 'cmielement' represents a score.
     if (!isset($this->other['cmivalue'])) {
         throw new \coding_exception("The 'cmivalue' must be set in other.");
     }
 }
开发者ID:gabrielrosset,项目名称:moodle,代码行数:25,代码来源:cmielement_submitted.php

示例15: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     if (!isset($this->relateduserid)) {
         throw new \coding_exception('The \'relateduserid\' must be set.');
     }
     if (!isset($this->other['forumid'])) {
         throw new \coding_exception('The \'forumid\' value must be set in other.');
     }
     if (!isset($this->other['discussion'])) {
         throw new \coding_exception('The \'discussion\' value must be set in other.');
     }
     if ($this->contextlevel != CONTEXT_MODULE) {
         throw new \coding_exception('Context level must be CONTEXT_MODULE.');
     }
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:22,代码来源:discussion_subscription_created.php


注:本文中的core\event\base::validate_data方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。