BaseVideo.class.php 2.94 KB
Newer Older
Яков's avatar
first  
Яков committed
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php

/**
 * BaseVideo
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property string $title
 * @property string $vid
 * @property string $cover
 * @property boolean $available
 * @property Doctrine_Collection $Tags
 * @property Doctrine_Collection $VideoTags
 * 
 * @method string              getTitle()     Returns the current record's "title" value
 * @method string              getVid()       Returns the current record's "vid" value
 * @method string              getCover()     Returns the current record's "cover" value
 * @method boolean             getAvailable() Returns the current record's "available" value
 * @method Doctrine_Collection getTags()      Returns the current record's "Tags" collection
 * @method Doctrine_Collection getVideoTags() Returns the current record's "VideoTags" collection
 * @method Video               setTitle()     Sets the current record's "title" value
 * @method Video               setVid()       Sets the current record's "vid" value
 * @method Video               setCover()     Sets the current record's "cover" value
 * @method Video               setAvailable() Sets the current record's "available" value
 * @method Video               setTags()      Sets the current record's "Tags" collection
 * @method Video               setVideoTags() Sets the current record's "VideoTags" collection
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseVideo extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('video');
        $this->hasColumn('title', 'string', 512, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 512,
             ));
        $this->hasColumn('vid', 'string', 255, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 255,
             ));
        $this->hasColumn('cover', 'string', 255, array(
             'type' => 'string',
             'notnull' => true,
             'length' => 255,
             ));
        $this->hasColumn('available', 'boolean', null, array(
             'type' => 'boolean',
             'default' => 0,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasMany('Tag as Tags', array(
             'refClass' => 'VideoTags',
             'local' => 'video_id',
             'foreign' => 'tag_id',
             'onDelete' => 'CASCADE'));

        $this->hasMany('VideoTags', array(
             'local' => 'id',
             'foreign' => 'video_id'));

        $timestampable0 = new Doctrine_Template_Timestampable();
        $i18n0 = new Doctrine_Template_I18n(array(
             'fields' => 
             array(
              0 => 'title',
              1 => 'available',
             ),
             ));
        $this->actAs($timestampable0);
        $this->actAs($i18n0);
    }
}