本文整理汇总了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.');
}
}
示例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.');
}
}
示例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.');
}
}
示例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.');
}
}
示例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.');
}
}
示例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.');
}
}
示例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.');
}
}
示例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.');
}
}
示例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.');
}
}
}
}
示例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.');
}
}
示例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.');
}
}
}
示例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;
}
}
示例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.');
}
}
示例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();
}
示例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.');
}
}