1 : <?php
2 :
3 0 : Doctrine_Manager::getInstance()->bindComponent('Categories', 'doctrine');
4 :
5 :
6 :
7 :
8 :
9 :
10 :
11 :
12 :
13 :
14 :
15 :
16 :
17 :
18 :
19 :
20 :
21 :
22 :
23 :
24 :
25 : abstract class BaseCategories extends Doctrine_Record
26 0 : {
27 : public function setTableDefinition()
28 : {
29 0 : $this->setTableName('categories');
30 0 : $this->hasColumn('id', 'integer', 4, array(
31 0 : 'type' => 'integer',
32 0 : 'fixed' => 0,
33 0 : 'unsigned' => true,
34 0 : 'primary' => true,
35 0 : 'autoincrement' => true,
36 0 : 'length' => '4',
37 0 : ));
38 0 : $this->hasColumn('instructor_id', 'integer', 4, array(
39 0 : 'type' => 'integer',
40 0 : 'fixed' => 0,
41 0 : 'unsigned' => true,
42 0 : 'primary' => false,
43 0 : 'notnull' => true,
44 0 : 'autoincrement' => false,
45 0 : 'length' => '4',
46 0 : ));
47 0 : $this->hasColumn('title', 'string', 100, array(
48 0 : 'type' => 'string',
49 0 : 'fixed' => 0,
50 0 : 'unsigned' => false,
51 0 : 'primary' => false,
52 0 : 'notnull' => true,
53 0 : 'autoincrement' => false,
54 0 : 'length' => '100',
55 0 : ));
56 0 : $this->hasColumn('ident', 'string', 50, array(
57 0 : 'type' => 'string',
58 0 : 'fixed' => 0,
59 0 : 'unsigned' => false,
60 0 : 'primary' => false,
61 0 : 'notnull' => true,
62 0 : 'autoincrement' => false,
63 0 : 'length' => '50',
64 0 : ));
65 0 : $this->hasColumn('short_desc', 'string', null, array(
66 0 : 'type' => 'string',
67 0 : 'fixed' => 0,
68 0 : 'unsigned' => false,
69 0 : 'primary' => false,
70 0 : 'notnull' => true,
71 0 : 'autoincrement' => false,
72 0 : 'length' => '',
73 0 : ));
74 0 : $this->hasColumn('desc', 'string', null, array(
75 0 : 'type' => 'string',
76 0 : 'fixed' => 0,
77 0 : 'unsigned' => false,
78 0 : 'primary' => false,
79 0 : 'notnull' => true,
80 0 : 'autoincrement' => false,
81 0 : 'length' => '',
82 0 : ));
83 0 : $this->hasColumn('last_update', 'timestamp', 25, array(
84 0 : 'type' => 'timestamp',
85 0 : 'fixed' => 0,
86 0 : 'unsigned' => false,
87 0 : 'primary' => false,
88 0 : 'notnull' => true,
89 0 : 'autoincrement' => false,
90 0 : 'length' => '25',
91 0 : ));
92 0 : }
93 :
94 : public function setUp()
95 : {
96 0 : parent::setUp();
97 0 : $this->hasOne('Instructors', array(
98 0 : 'local' => 'instructor_id',
99 0 : 'foreign' => 'id'));
100 :
101 0 : $this->hasMany('Workshops', array(
102 0 : 'local' => 'id',
103 0 : 'foreign' => 'category_id'));
104 0 : }
|