當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。