summaryrefslogtreecommitdiff
path: root/app/php/model/Entry.php
blob: 4b93f04b60d42dd47cfe939287a4db003c34c55b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php

Prado::using('Application.db.ActiveRecord');
Prado::using('Application.model.Calendar');

class Entry extends ActiveRecord {

    const TABLE = 'entries';

    public $ID;
    public $UID;
    public $BeginDate;
    public $EndDate;
    public $AllDay;
    public $Name;
    public $Location;
    public $LastModified;

    public $CalendarID;

    public static $COLUMN_MAPPING = [
        'id' => 'ID',
        'uid' => 'UID',
        'begin_date' => 'BeginDate',
        'end_date' => 'EndDate',
        'all_day' => 'AllDay',
        'name' => 'Name',
        'location' => 'Location',
        'last_modified' => 'LastModified',
        '_calendar' => 'CalendarID'
    ];

    public static $RELATIONS = [
        'Calendar' => [self::BELONGS_TO, 'Calendar', '_calendar']
    ];

    public static function finder($className=__CLASS__) {
        return parent::finder($className);
    }

}

?>