diff options
Diffstat (limited to 'lib/models/Contact.class.php')
| -rw-r--r-- | lib/models/Contact.class.php | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/lib/models/Contact.class.php b/lib/models/Contact.class.php deleted file mode 100644 index 16bff26..0000000 --- a/lib/models/Contact.class.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -/** - * Contact.class.php - model class for table contact - * - * @author <mlunzena@uos.de> - * @license GPL 2 or later - * - * @property array $id alias for pk - * @property string $owner_id database column - * @property string $user_id database column - * @property string $calendar_permissions database column - * An enum with the possible values "", "READ" and "WRITE". - * The empty string specifies that no calendar permissions are granted. - * @property User $owner belongs_to User - * @property User $friend belongs_to User - * @property string $mkdate database column - * @property string $chdate database column - */ -class Contact extends SimpleORMap -{ - protected static function configure($config = []) - { - $config['db_table'] = 'contact'; - - $config['belongs_to']['owner'] = [ - 'class_name' => User::class, - 'foreign_key' => 'owner_id' - ]; - $config['belongs_to']['friend'] = [ - 'class_name' => User::class, - 'foreign_key' => 'user_id' - ]; - - $config['has_many']['groups'] = [ - 'class_name' => ContactGroupItem::class, - 'assoc_func' => 'findByContact', - 'foreign_key' => function ($me) { - return [$me]; - }, - 'assoc_foreign_key' => function ($item, $params) { - //Nothing else here. But this has to be present - //so that storing a new contact works. - }, - 'on_store' => 'store', - 'on_delete' => 'delete' - ]; - - parent::configure($config); - } -} |
