/** * Construct validation rules for the current scope * * @return Cake\Validation\Validator */ public function validator() { $validator = parent::validator(); $actionValidator = $this->newValidator(); $actionValidator->addNested('name', $this->getI18nValidator()); $validator->requirePresence('key'); $validator->add('key', ['required' => ['rule' => 'notBlank']]); $validator->addNested('title', $this->getI18nValidator()); $filterValidator = $this->newValidator(); $filterValidator->addNested('placeholder', $this->getI18nValidator()); $sizeValidator = $this->newValidator(); $sizeValidator->requirePresence('height'); $sizeValidator->requirePresence('width'); $optionsValidator = $this->newValidator(); $optionsValidator->addNested('filter', $filterValidator); $optionsValidator->addNested('hint', $this->getI18nValidator()); $optionsValidator->addNested('primaryAction', $actionValidator); $optionsValidator->addNested('size', $sizeValidator); $optionsValidator->addNestedMany('secondaryActions', $actionValidator); $optionsValidator->add('style', ['required' => ['rule' => 'notBlank'], 'valid' => ['rule' => ['inList', ['normal', 'warning']]]]); $validator->addNested('options', $optionsValidator); $validator->requirePresence('url'); $validator->add('url', ['required' => ['rule' => 'notBlank'], 'url' => ['rule' => 'url']]); return $validator; }
/** * Construct validation rules for the current scope * * @return Cake\Validation\Validator */ public function validator() { $validator = parent::validator(); $validator->addNested('avatar', $this->getIconValidator()); $validator->add('fromName', ['required' => ['rule' => 'notBlank']]); $validator->requirePresence('scopes'); $validator->add('scopes', ['valid' => ['rule' => ['multiple', ['admin_group', 'admin_room', 'import_data', 'manage_rooms', 'send_message', 'send_notification', 'view_group', 'view_messages', 'view_room']]]]); return $validator; }
/** * Construct validation rules for the current scope * * @return Cake\Validation\Validator */ public function validator() { $validator = parent::validator(); $validator->add('allowGlobal', ['valid' => ['rule' => 'boolean']]); $validator->add('allowRoom', ['valid' => ['rule' => 'boolean']]); $validator->add('callbackUrl', ['required' => ['rule' => 'notBlank'], 'url' => ['rule' => 'url']]); $validator->add('installedUrl', ['required' => ['rule' => 'notBlank'], 'url' => ['rule' => 'url']]); $validator->add('uninstalledUrl', ['required' => ['rule' => 'notBlank'], 'url' => ['rule' => 'url']]); return $validator; }
/** * Construct validation rules for the current scope * * @return Cake\Validation\Validator */ public function validator() { $validator = parent::validator(); $validator->requirePresence('url'); $validator->add('url', ['required' => ['rule' => 'notBlank'], 'url' => ['rule' => 'url']]); $validator->add('pattern', []); $validator->requirePresence('event'); $validator->add('event', ['required' => ['rule' => 'notBlank'], 'valid' => ['rule' => ['inList', ['room_archived', 'room_created', 'room_deleted', 'room_enter', 'room_exit', 'room_file_upload', 'room_message', 'room_notification', 'room_topic_change', 'room_unarchived']]]]); $validator->add('authentication', ['valid' => ['rule' => ['inList', ['jwt', 'none']]]]); $validator->add('name', []); return $validator; }
/** * Construct validation rules for the current scope * * @return Cake\Validation\Validator */ public function validator() { $validator = parent::validator(); $validator->addNested('icon', $this->getIconValidator()); $validator->requirePresence('key'); $validator->add('key', ['required' => ['rule' => 'notBlank']]); $validator->addNested('name', $this->getI18nValidator()); $validator->requirePresence('queryUrl'); $validator->add('queryUrl', ['required' => ['rule' => 'notBlank'], 'url' => ['rule' => 'url']]); $validator->add('target', []); $validator->add('weight', ['valid' => ['rule' => 'isInteger']]); return $validator; }
/** * Construct validation rules for the current scope * * @return Cake\Validation\Validator */ public function validator() { $validator = parent::validator(); $validator->requirePresence('key'); $validator->add('key', ['required' => ['rule' => 'notBlank']]); $validator->requirePresence('location'); $validator->add('location', ['required' => ['rule' => 'notBlank'], 'valid' => ['rule' => ['inList', ['hipchat.message.action', 'hipchat.input.action']]]]); $nameValidator = $this->newValidator(); $nameValidator->requirePresence('value'); $validator->addNested('name', $nameValidator); $validator->add('target', []); $validator->add('weight', ['valid' => ['rule' => 'isInteger']]); return $validator; }