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


PHP base::validate_data方法代码示例

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


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

示例1: validate_data

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

示例2: validate_data

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

示例3: validate_data

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

示例4: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception on error.
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     if ($this->contextlevel != CONTEXT_MODULE) {
         throw new \coding_exception('Context passed must be module context.');
     }
 }
开发者ID:evltuma,项目名称:moodle,代码行数:13,代码来源:assessable_submitted.php

示例5: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception
  */
 protected function validate_data()
 {
     parent::validate_data();
     if (!isset($this->relateduserid)) {
         throw new \coding_exception('The \'relateduserid\' must be set.');
     }
     if (!isset($this->other['info'])) {
         throw new \coding_exception('The \'info\' value must be set in other.');
     }
 }
开发者ID:juacas,项目名称:moodle-mod_blended,代码行数:15,代码来源:blended_viewed.php

示例6: validate_data

 /**
  * Custom validations.
  *
  * @throws \coding_exception
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     if (!isset($this->other['badgeid'])) {
         throw new \coding_exception('The \'badgeid\' must be set in other.');
     }
     if (!isset($this->other['badgehash'])) {
         throw new \coding_exception('The \'badgehash\' must be set in other.');
     }
 }
开发者ID:janeklb,项目名称:moodle,代码行数:16,代码来源:badge_viewed.php

示例7: validate_data

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

示例8: validate_data

 /**
  * Custom validation.
  *
  * Throw \coding_exception notice in case of any problems.
  */
 protected function validate_data()
 {
     parent::validate_data();
     if (!isset($this->other['repeatid'])) {
         throw new \coding_exception('The \'repeatid\' value must be set in other.');
     }
     if (empty($this->other['name'])) {
         throw new \coding_exception('The \'name\' value must be set in other.');
     }
     if (!isset($this->other['timestart'])) {
         throw new \coding_exception('The \'timestart\' value must be set in other.');
     }
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:18,代码来源:calendar_event_deleted.php

示例9: validate_data

 /**
  * Validation that should be shared among child classes.
  *
  * @throws \coding_exception when validation fails.
  * @return void
  */
 protected function validate_data()
 {
     parent::validate_data();
     if ($this->contextlevel != CONTEXT_MODULE) {
         throw new \coding_exception('Context level must be CONTEXT_MODULE.');
     } else {
         if (!isset($this->other['pathnamehashes']) || !is_array($this->other['pathnamehashes'])) {
             throw new \coding_exception('The \'pathnamehashes\' value must be set in other and must be an array.');
         } else {
             if (!isset($this->other['content']) || !is_string($this->other['content'])) {
                 throw new \coding_exception('The \'content\' value must be set in other and must be a string.');
             }
         }
     }
 }
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:21,代码来源:assessable_uploaded.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['tagid'])) {
         throw new \coding_exception('The \'tagid\' value must be set in other.');
     }
     if (!isset($this->other['itemid'])) {
         throw new \coding_exception('The \'itemid\' value must be set in other.');
     }
     if (!isset($this->other['itemtype'])) {
         throw new \coding_exception('The \'itemtype\' value must be set in other.');
     }
     if (!isset($this->other['tagname'])) {
         throw new \coding_exception('The \'tagname\' value must be set in other.');
     }
     if (!isset($this->other['tagrawname'])) {
         throw new \coding_exception('The \'tagrawname\' value must be set in other.');
     }
 }
开发者ID:alanaipe2015,项目名称:moodle,代码行数:25,代码来源:tag_removed.php

示例11: validate_data

    /**
     * Custom validation.
     *
     * @throws \coding_exception
     * @return void
     */
    protected function validate_data() {
        global $CFG;

        if ($CFG->debugdeveloper) {
            parent::validate_data();
            if (!isset($this->other['username'])) {
                throw new \coding_exception('username must be set in $other.');
            }

            if (!isset($this->other['email'])) {
                throw new \coding_exception('email must be set in $other.');
            }

            if (!isset($this->other['idnumber'])) {
                throw new \coding_exception('idnumber must be set in $other.');
            }

            if (!isset($this->other['picture'])) {
                throw new \coding_exception('picture must be set in $other.');
            }

            if (!isset($this->other['mnethostid'])) {
                throw new \coding_exception('mnethostid must be set in $other.');
            }
        }
    }
开发者ID:rwijaya,项目名称:moodle,代码行数:32,代码来源:user_deleted.php

示例12: 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:janaece,项目名称:globalclassroom4_clean,代码行数:14,代码来源:user_updated.php

示例13: validate_data

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

示例14: validate_data

 /**
  * Custom validation.
  *
  * @throws \coding_exception
  * @return void
  */
 protected function validate_data()
 {
     if (self::$preventcreatecall) {
         throw new \coding_exception('cannot call all_submissions_downloaded::create() directly, use all_submissions_downloaded::create_from_assign() instead.');
     }
     parent::validate_data();
 }
开发者ID:evltuma,项目名称:moodle,代码行数:13,代码来源:all_submissions_downloaded.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['messagetable'])) {
         throw new \coding_exception('The \'messagetable\' value must be set in other.');
     }
     if (!isset($this->other['messageid'])) {
         throw new \coding_exception('The \'messageid\' value must be set in other.');
     }
     if (!isset($this->other['useridfrom'])) {
         throw new \coding_exception('The \'useridfrom\' value must be set in other.');
     }
     if (!isset($this->other['useridto'])) {
         throw new \coding_exception('The \'useridto\' value must be set in other.');
     }
 }
开发者ID:uniedpa,项目名称:moodle,代码行数:25,代码来源:message_deleted.php


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