Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

adds static flushStatic method to CActiveRecord as described in issue #2... #2006

Closed
wants to merge 1 commit into from

3 participants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 0 deletions.
  1. +11 −0 framework/db/ar/CActiveRecord.php
View
11 framework/db/ar/CActiveRecord.php
@@ -390,6 +390,17 @@ public static function model($className=__CLASS__)
return $model;
}
}
+
+ /**
+ * Clears all cached instances of static ActiveRecord models
+ * provided for invoking class-level methods (something similar to static class methods.)
+ *
+ * @return null
+ */
+ public static function flushStatic()
+ {
+ self::$_models = array();
+ }
/**
* Returns the meta-data for this AR
Something went wrong with that request. Please try again.