From cc09e963e8ef7ea093c7b13096856e5c732cd776 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 15 Mar 2016 22:06:47 +0100 Subject: * extending TActiveRecord so it's capable of fetching mapped column fields from sql maps --- app/php/model/Calendar.php | 11 ++++++----- app/php/model/Category.php | 7 ++++--- app/php/model/Entry.php | 7 ++++--- app/php/model/User.php | 3 ++- app/php/model/UserPreference.php | 4 +++- 5 files changed, 19 insertions(+), 13 deletions(-) (limited to 'app/php/model') diff --git a/app/php/model/Calendar.php b/app/php/model/Calendar.php index 4438572..9e1afce 100644 --- a/app/php/model/Calendar.php +++ b/app/php/model/Calendar.php @@ -1,12 +1,13 @@ 'Website', 'visible' => 'Visible', 'last_updated' => 'LastUpdated', - '_category' => 'CategoryID' + '_category' => 'CategoryID' ]; public static $RELATIONS = [ 'Entries' => [self::HAS_MANY, 'Entry', '_calendar'], 'Category' => [self::BELONGS_TO, 'Category', '_category'] ]; - + public static function finder($className=__CLASS__) { return parent::finder($className); } - + } ?> diff --git a/app/php/model/Category.php b/app/php/model/Category.php index 03a368a..5e71e53 100644 --- a/app/php/model/Category.php +++ b/app/php/model/Category.php @@ -1,8 +1,9 @@ [self::HAS_MANY, 'Calendar', '_category'] ]; - + public static function finder($className=__CLASS__) { return parent::finder($className); } - + } ?> diff --git a/app/php/model/Entry.php b/app/php/model/Entry.php index 85d522f..3106e8e 100644 --- a/app/php/model/Entry.php +++ b/app/php/model/Entry.php @@ -1,8 +1,9 @@ [self::BELONGS_TO, 'Calendar', '_calendar'] ]; - + public static function finder($className=__CLASS__) { return parent::finder($className); } - + } ?> diff --git a/app/php/model/User.php b/app/php/model/User.php index b31b926..baa9912 100644 --- a/app/php/model/User.php +++ b/app/php/model/User.php @@ -1,8 +1,9 @@