@@ -918,15 +918,13 @@ public function validator($name = 'default', Validator $instance = null) {
918
918
return $ this ->_validators [$ name ];
919
919
}
920
920
921
- if ($ instance ! == null ) {
922
- $ instance-> provider ( ' table ' , $ this );
923
- return $ this ->_validators [ $ name ] = $ instance ;
921
+ if ($ instance = == null ) {
922
+ $ instance = new Validator ( );
923
+ $ instance = $ this ->{ ' validation ' . ucfirst ( $ name )}( $ instance) ;
924
924
}
925
925
926
- $ validator = new Validator ;
927
- $ validator = $ this ->{'validation ' . ucfirst ($ name )}($ validator );
928
- $ validator ->provider ('table ' , $ this );
929
- return $ this ->_validators [$ name ] = $ validator ;
926
+ $ instance ->provider ('table ' , $ this );
927
+ return $ this ->_validators [$ name ] = $ instance ;
930
928
}
931
929
932
930
/**
@@ -1632,21 +1630,21 @@ public function validate($entity, $options = []) {
1632
1630
* saved.
1633
1631
*
1634
1632
* {{{
1635
- * $articles->validate ([$article1, $article2]);
1633
+ * $articles->validateMany ([$article1, $article2]);
1636
1634
* }}}
1637
1635
*
1638
1636
* You can specify which validation set to use using the options array:
1639
1637
*
1640
1638
* {{{
1641
- * $users->validate ([$user1, $user2], ['validate' => 'forSignup']);
1639
+ * $users->validateMany ([$user1, $user2], ['validate' => 'forSignup']);
1642
1640
* }}}
1643
1641
*
1644
1642
* By default all the associations on this table will be validated if they can
1645
1643
* be found in the passed entities. You can limit which associations are built,
1646
1644
* or include deeper associations using the options parameter
1647
1645
*
1648
1646
* {{{
1649
- * $articles->validate ([$article1, $article2], [
1647
+ * $articles->validateMany ([$article1, $article2], [
1650
1648
* 'associated' => [
1651
1649
* 'Tags',
1652
1650
* 'Comments' => [
0 commit comments