File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -3501,17 +3501,20 @@ public function onError() {
3501
3501
protected function _clearCache ($ type = null ) {
3502
3502
if ($ type === null ) {
3503
3503
if (Configure::read ('Cache.check ' ) === true ) {
3504
- $ assoc [] = strtolower (Inflector::pluralize ($ this ->alias ));
3505
- $ assoc [] = strtolower (Inflector::underscore (Inflector::pluralize ($ this ->alias )));
3506
- foreach ($ this ->_associations as $ key => $ association ) {
3507
- foreach ($ this ->$ association as $ key => $ className ) {
3508
- $ check = strtolower (Inflector::pluralize ($ className ['className ' ]));
3509
- if (!in_array ($ check , $ assoc )) {
3510
- $ assoc [] = strtolower (Inflector::pluralize ($ className ['className ' ]));
3511
- $ assoc [] = strtolower (Inflector::underscore (Inflector::pluralize ($ className ['className ' ])));
3504
+ $ pluralized = Inflector::pluralize ($ this ->alias );
3505
+ $ assoc [$ this ->alias ] = strtolower ($ pluralized );
3506
+ $ assoc [] = strtolower (Inflector::underscore ($ pluralized ));
3507
+ foreach ($ this ->_associations as $ association ) {
3508
+ foreach ($ this ->$ association as $ associatedClass ) {
3509
+ $ className = $ associatedClass ['className ' ];
3510
+ if (!isset ($ assoc [$ className ])) {
3511
+ $ pluralized = Inflector::pluralize ($ className );
3512
+ $ assoc [$ className ] = strtolower ($ pluralized );
3513
+ $ assoc [] = strtolower (Inflector::underscore ($ pluralized ));
3512
3514
}
3513
3515
}
3514
3516
}
3517
+ $ assoc = array_unique ($ assoc );
3515
3518
clearCache ($ assoc );
3516
3519
return true ;
3517
3520
}
You can’t perform that action at this time.
0 commit comments