BasePermission.class.php 2.02 KB
Newer Older
Игорь's avatar
init    
Игорь 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
<?php

/**
 * BasePermission
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property string $credential
 * @property string $description
 * @property Doctrine_Collection $User
 * @property Doctrine_Collection $UserGroup
 * 
 * @method string              getCredential()  Returns the current record's "credential" value
 * @method string              getDescription() Returns the current record's "description" value
 * @method Doctrine_Collection getUser()        Returns the current record's "User" collection
 * @method Doctrine_Collection getUserGroup()   Returns the current record's "UserGroup" collection
 * @method Permission          setCredential()  Sets the current record's "credential" value
 * @method Permission          setDescription() Sets the current record's "description" value
 * @method Permission          setUser()        Sets the current record's "User" collection
 * @method Permission          setUserGroup()   Sets the current record's "UserGroup" collection
 * 
 * @package    sf
 * @subpackage model
 * @author     Atma
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BasePermission extends sfDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('permission');
        $this->hasColumn('credential', 'string', 255, array(
             'type' => 'string',
             'notnull' => true,
             'unique' => true,
             'length' => 255,
             ));
        $this->hasColumn('description', 'string', 255, array(
             'type' => 'string',
             'length' => 255,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasMany('User', array(
             'refClass' => 'UserPermissions',
             'local' => 'permission_id',
             'foreign' => 'user_id'));

        $this->hasMany('UserGroup', array(
             'refClass' => 'UserGroupPermissions',
             'local' => 'permission_id',
             'foreign' => 'user_group_id'));
    }
}