diff options
author | emkael <emkael@tlen.pl> | 2016-11-02 16:10:15 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-11-02 16:10:15 +0100 |
commit | d0dc1a56c91a6c257cb5c89286679952f7656ed9 (patch) | |
tree | b230722b369b15d3fef264baa019a1d2b32c7af3 /app | |
parent | 9dad23eb566c3651d0f978bf49b1a5777ae095f6 (diff) |
* cleanup in frontend records design
Diffstat (limited to 'app')
-rw-r--r-- | app/frontend/db/ActiveRecord.php | 7 | ||||
-rw-r--r-- | app/frontend/model/Calendar.php | 4 | ||||
-rw-r--r-- | app/frontend/model/Category.php | 4 | ||||
-rw-r--r-- | app/frontend/model/Entry.php | 4 | ||||
-rw-r--r-- | app/frontend/model/User.php | 4 | ||||
-rw-r--r-- | app/frontend/model/UserAuthKey.php | 4 | ||||
-rw-r--r-- | app/frontend/model/UserPreference.php | 4 |
7 files changed, 7 insertions, 24 deletions
diff --git a/app/frontend/db/ActiveRecord.php b/app/frontend/db/ActiveRecord.php index 1176767..31f87f5 100644 --- a/app/frontend/db/ActiveRecord.php +++ b/app/frontend/db/ActiveRecord.php @@ -64,6 +64,13 @@ class ActiveRecord extends TActiveRecord { return parent::__call($this->_getMappedMethodName($method), $args); } + public static function finder($className=NULL) { + if (NULL === $className) { + $className = get_called_class(); + } + return parent::finder($className); + } + } ?> diff --git a/app/frontend/model/Calendar.php b/app/frontend/model/Calendar.php index b49bf92..47197ef 100644 --- a/app/frontend/model/Calendar.php +++ b/app/frontend/model/Calendar.php @@ -38,10 +38,6 @@ class Calendar extends ActiveRecord { 'Category' => [self::BELONGS_TO, 'Category', '_category'] ]; - public static function finder($className=__CLASS__) { - return parent::finder($className); - } - const CUSTOM_IMAGE_PATH = 'resources/images/calendars'; public function getCustomImageUrl() { diff --git a/app/frontend/model/Category.php b/app/frontend/model/Category.php index 87b97b6..254658b 100644 --- a/app/frontend/model/Category.php +++ b/app/frontend/model/Category.php @@ -21,10 +21,6 @@ class Category extends ActiveRecord { 'Calendars' => [self::HAS_MANY, 'Calendar', '_category'] ]; - public static function finder($className=__CLASS__) { - return parent::finder($className); - } - } ?> diff --git a/app/frontend/model/Entry.php b/app/frontend/model/Entry.php index 4b93f04..1249118 100644 --- a/app/frontend/model/Entry.php +++ b/app/frontend/model/Entry.php @@ -34,10 +34,6 @@ class Entry extends ActiveRecord { 'Calendar' => [self::BELONGS_TO, 'Calendar', '_calendar'] ]; - public static function finder($className=__CLASS__) { - return parent::finder($className); - } - } ?> diff --git a/app/frontend/model/User.php b/app/frontend/model/User.php index 043269a..21335e2 100644 --- a/app/frontend/model/User.php +++ b/app/frontend/model/User.php @@ -32,10 +32,6 @@ class User extends ActiveRecord { 'AuthKeys' => [self::HAS_MANY, 'UserAuthKey', '_user'] ]; - public static function finder($className=__CLASS__) { - return parent::finder($className); - } - } ?> diff --git a/app/frontend/model/UserAuthKey.php b/app/frontend/model/UserAuthKey.php index 64d9e65..2ace876 100644 --- a/app/frontend/model/UserAuthKey.php +++ b/app/frontend/model/UserAuthKey.php @@ -24,10 +24,6 @@ class UserAuthKey extends ActiveRecord { 'User' => [self::BELONGS_TO, 'User', '_user'] ]; - public static function finder($className=__CLASS__) { - return parent::finder($className); - } - } ?> diff --git a/app/frontend/model/UserPreference.php b/app/frontend/model/UserPreference.php index 90fa221..0741128 100644 --- a/app/frontend/model/UserPreference.php +++ b/app/frontend/model/UserPreference.php @@ -14,10 +14,6 @@ class UserPreference extends ActiveRecord { '_calendar' => 'CalendarID' ]; - public static function finder($className=__CLASS__) { - return parent::finder($className); - } - } ?> |