@@ 147-158 (lines=12) @@ | ||
144 | * |
|
145 | * @return bool |
|
146 | */ |
|
147 | public function validateCreation(array $values) |
|
148 | { |
|
149 | $v = new Validator($values, [ |
|
150 | new Validators\Integer('project_id', t('This value must be an integer')), |
|
151 | new Validators\Required('project_id', t('The project is required')), |
|
152 | new Validators\Required('title', t('The title is required')), |
|
153 | new Validators\MaxLength('title', t('The maximum length is %d characters', 200), 200), |
|
154 | new Validators\MaxLength('reference', t('The maximum length is %d characters', 50), 50), |
|
155 | ]); |
|
156 | ||
157 | return $v->execute(); |
|
158 | } |
|
159 | } |
|
160 |
@@ 111-122 (lines=12) @@ | ||
108 | * |
|
109 | * @return bool |
|
110 | */ |
|
111 | public function validateCreation(array $values) |
|
112 | { |
|
113 | $v = new Validator($values, [ |
|
114 | new Validators\MaxLength('username', t('The maximum length is %d characters', 50), 50), |
|
115 | new Validators\Unique('username', t('The username must be unique'), $this->db->getConnection(), UserModel::TABLE, 'id'), |
|
116 | new Validators\MinLength('password', t('The minimum length is %d characters', 6), 6), |
|
117 | new Validators\Email('email', t('Email address invalid')), |
|
118 | new Validators\Integer('is_ldap_user', t('This value must be an integer')), |
|
119 | ]); |
|
120 | ||
121 | return $v->execute(); |
|
122 | } |
|
123 | } |
|
124 |