File tree Expand file tree Collapse file tree
tests/utest/orm/func/object Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ public function getData(IFormElement $element)
6161 /**
6262 * {@inheritdoc}
6363 */
64- public function validate (IFormElement $ element )
64+ public function validate (IFormElement $ element, $ value )
6565 {
6666 return true ;
6767 }
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ public function getData(IFormElement $element)
6161 /**
6262 * {@inheritdoc}
6363 */
64- public function validate (IFormElement $ element )
64+ public function validate (IFormElement $ element, $ value )
6565 {
6666 return true ;
6767 }
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function getData(IFormElement $element)
5757 /**
5858 * {@inheritdoc}
5959 */
60- public function validate (IFormElement $ element )
60+ public function validate (IFormElement $ element, $ value )
6161 {
6262 return true ;
6363 }
Original file line number Diff line number Diff line change @@ -35,9 +35,10 @@ public function getData(IFormElement $element);
3535 /**
3636 * Валидирует значение провайдера данных.
3737 * @param IFormElement $element элемент формы, для которого формируется значение
38+ * @param mixed $value значение
3839 * @return bool
3940 */
40- public function validate (IFormElement $ element );
41+ public function validate (IFormElement $ element, $ value );
4142
4243 /**
4344 * Возвращает ошибки валидации провайдера данных.
Original file line number Diff line number Diff line change @@ -113,10 +113,10 @@ public function getData(IFormElement $element)
113113 /**
114114 * {@inheritdoc}
115115 */
116- public function validate (IFormElement $ element )
116+ public function validate (IFormElement $ element, $ value )
117117 {
118118 if ($ dataSource = $ element ->getDataSource ()) {
119- return $ this ->data ->getPropertyByPath ($ dataSource )->validate ();
119+ return $ this ->data ->getPropertyByPath ($ dataSource )->validate ($ value );
120120 }
121121
122122 return true ;
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ protected function validate($value)
202202 {
203203 $ isValid =
204204 $ this ->getValidators ()->isValid ($ value ) &&
205- $ this ->getDataAdapter ()->validate ($ this );
205+ $ this ->getDataAdapter ()->validate ($ this , $ value );
206206
207207 $ this ->messages = array_merge (
208208 $ this ->getValidators ()->getMessages (),
Original file line number Diff line number Diff line change @@ -647,7 +647,7 @@ public function validate()
647647 $ result = true ;
648648
649649 foreach ($ this ->getAllProperties () as $ property ) {
650- if (!$ property ->validate ()) {
650+ if (!$ property ->validate ($ property -> getValue () )) {
651651 $ this ->validationErrors [$ property ->getFullName ()] = $ property ->getValidationErrors ();
652652 $ result = false ;
653653 }
Original file line number Diff line number Diff line change @@ -128,10 +128,11 @@ public function getLocaleId();
128128 public function rollback ();
129129
130130 /**
131- * Производит валидацию
131+ * Производит валидацию.
132+ * @param mixed $value значение
132133 * @return bool результат валидации
133134 */
134- public function validate ();
135+ public function validate ($ value );
135136
136137 /**
137138 * Возвращает список ошибок валидации
Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ public function update($value)
335335 /**
336336 * {@inheritdoc}
337337 */
338- public function validate ()
338+ public function validate ($ value )
339339 {
340340 $ result = true ;
341341 $ this ->validationErrors = [];
@@ -350,7 +350,7 @@ public function validate()
350350 if ($ validators = $ this ->getField ()->getValidatorsConfig ($ this ->getLocaleId ())) {
351351
352352 $ validatorCollection = $ this ->createValidatorCollection ($ validators );
353- if (!$ validatorCollection ->isValid ($ this -> getValue () )) {
353+ if (!$ validatorCollection ->isValid ($ value )) {
354354 $ this ->addValidationErrors ($ validatorCollection ->getMessages ());
355355 $ result = false ;
356356 }
Original file line number Diff line number Diff line change @@ -29,9 +29,18 @@ protected function getCollectionConfig()
2929 self ::USERS_USER => [
3030 'type ' => ICollectionFactory::TYPE_SIMPLE
3131 ],
32+ self ::USERS_PROFILE => [
33+ 'type ' => ICollectionFactory::TYPE_SIMPLE
34+ ],
3235 self ::USERS_GROUP => [
3336 'type ' => ICollectionFactory::TYPE_SIMPLE
34- ]
37+ ],
38+ self ::BLOGS_BLOG => [
39+ 'type ' => ICollectionFactory::TYPE_SIMPLE_HIERARCHIC ,
40+ ],
41+ self ::BLOGS_SUBSCRIBER => [
42+ 'type ' => ICollectionFactory::TYPE_SIMPLE
43+ ],
3544 ],
3645 true
3746 ];
You can’t perform that action at this time.
0 commit comments