Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //corrected schema
- DmUser:
- actAs: [Timestampable]
- columns:
- username:
- type: string(255)
- notnull: true
- unique: true
- email:
- type: string(255)
- notnull: true
- unique: true
- algorithm:
- type: string(128)
- default: sha1
- notnull: true
- salt: string(128)
- password: string(128)
- is_active:
- type: boolean
- default: true
- is_super_admin:
- type: boolean
- default: false
- last_login:
- type: timestamp
- forgot_password_code:
- type: string(12)
- unique: true
- indexes:
- is_active_idx:
- fields: [is_active]
- relations:
- Groups:
- class: DmGroup
- local: dm_user_id
- foreign: dm_group_id
- refClass: DmUserGroup
- foreignAlias: Users
- Permissions:
- class: DmPermission
- local: dm_user_id
- foreign: dm_permission_id
- refClass: DmUserPermission
- foreignAlias: Users
- Records:
- class: DmRecordPermission
- local: dm_user_id
- foreign: dm_record_permission_id
- refClass: DmRecordPermissionUser
- foreignAlias: Users
- RecordsPermissionsAssociations:
- class: DmRecordPermissionAssociation
- refClass: DmRecordPermissionAssociationUser
- local: dm_user_id
- foreign: dm_record_permission_association_id
- foreignAlias: Users
- DmRecordPermissionUser:
- options:
- symfony:
- form: false
- filter: false
- columns:
- dm_user_id: {type: integer(11), notnull: true, primary: true}
- dm_record_permission_id: {type: integer(11), notnull: true, primary: true}
- relations:
- User:
- class: DmUser
- local: dm_user_id
- onDelete: CASCADE
- foreignAlias: Records
- Record:
- class: DmRecordPermission
- local: dm_record_permission_id
- onDelete: CASCADE
- foreignAlias: Users
- DmGroup:
- actAs: [Timestampable]
- columns:
- name:
- type: string(255)
- unique: true
- description: string(1000)
- relations:
- Users:
- class: DmUser
- refClass: DmUserGroup
- local: dm_group_id
- foreign: dm_user_id
- foreignAlias: Groups
- Permissions:
- class: DmPermission
- local: dm_group_id
- foreign: dm_permission_id
- refClass: DmGroupPermission
- foreignAlias: Groups
- Records:
- class: DmRecordPermission
- local: dm_group_id
- foreign: dm_record_permission_id
- refClass: DmRecordPermissionGroup
- foreignAlias: Groups
- RecordsPermissionsAssociations:
- class: DmRecordPermissionAssociation
- refClass: DmRecordPermissionAssociationGroup
- local: dm_group_id
- foreign: dm_record_permission_association_id
- foreignAlias: Groups
- DmRecordPermissionGroup:
- options:
- symfony:
- form: false
- filter: false
- columns:
- dm_group_id: {type: integer(11), notnull: true, primary: true}
- dm_record_permission_id: {type: integer(11), notnull: true, primary: true}
- relations:
- Group:
- class: DmGroup
- local: dm_group_id
- onDelete: CASCADE
- foreignAlias: Records
- Record:
- class: DmRecordPermission
- local: dm_record_permission_id
- onDelete: CASCADE
- foreignAlias: Groups
- DmPermission:
- actAs: [Timestampable]
- columns:
- name:
- type: string(255)
- unique: true
- description: string(5000)
- DmGroupPermission:
- options:
- symfony:
- form: false
- filter: false
- columns:
- dm_group_id:
- type: integer
- primary: true
- dm_permission_id:
- type: integer
- primary: true
- relations:
- Group:
- class: DmGroup
- local: dm_group_id
- onDelete: CASCADE
- foreignAlias: Permissions
- Permission:
- class: DmPermission
- local: dm_permission_id
- onDelete: CASCADE
- foreignAlias: Groups
- DmUserPermission:
- options:
- symfony:
- form: false
- filter: false
- columns:
- dm_user_id:
- type: integer
- primary: true
- dm_permission_id:
- type: integer
- primary: true
- relations:
- User:
- class: DmUser
- local: dm_user_id
- onDelete: CASCADE
- foreignAlias: Permissions
- Permission:
- class: DmPermission
- local: dm_permission_id
- onDelete: CASCADE
- foreignAlias: Users
- DmUserGroup:
- options:
- symfony:
- form: false
- filter: false
- columns:
- dm_user_id:
- type: integer
- primary: true
- dm_group_id:
- type: integer
- primary: true
- relations:
- User:
- class: DmUser
- local: dm_user_id
- onDelete: CASCADE
- foreignAlias: Groups
- Group:
- class: DmGroup
- local: dm_group_id
- onDelete: CASCADE
- foreignAlias: Users
- DmRecordPermission:
- columns:
- secure_module: {type: string(255), notnull: true}
- secure_action: {type: string(255), notnull: true}
- secure_model: {type: string(255), notnull: true}
- secure_record: {type: integer(14), notnull: true}
- description: string(1000)
- relations:
- Users:
- class: DmUser
- local: dm_record_permission_id
- foreign: dm_user_id
- refClass: DmRecordPermissionUser
- foreignAlias: RecordsPermissions
- Groups:
- class: DmGroup
- local: dm_record_permission_id
- foreign: dm_group_id
- refClass: DmRecordPermissionGroup
- foreignAlias: RecordsPermissions
- indexes:
- #idx_secure_module_action_model:
- ## Records Permissions Associations
- DmRecordPermissionAssociation:
- columns:
- dm_secure_action:
- type: string(255)
- dm_secure_module:
- type: string(255)
- dm_secure_model:
- type: string(255)
- relations:
- Groups:
- class: DmGroup
- refClass: DmRecordPermissionAssociationGroup
- local: dm_record_permission_association_id
- foreign: dm_group_id
- foreignAlias: RecordsPermissionsAssociations
- Users:
- class: DmUser
- refClass: DmRecordPermissionAssociationUser
- local: dm_record_permission_association_id
- foreign: dm_user_id
- foreignAlias: RecordsPermissionsAssociations
- DmRecordPermissionAssociationGroup:
- options:
- symfony:
- form: false
- filter: false
- columns:
- dm_group_id: { type: integer(11), notnull: true}
- dm_record_permission_association_id: {type: integer(11), notnull: true}
- relations:
- Association:
- class: DmRecordPermissionAssociation
- local: dm_record_permission_association_id
- onDelete: CASCADE
- foreignAlias: Groups
- Group:
- class: DmGroup
- local: dm_group_id
- onDelete: CASCADE
- foreignAlias: RecordsPermissionsAssociation
- DmRecordPermissionAssociationUser:
- options:
- symfony:
- form: false
- filter: false
- columns:
- dm_user_id: {type: integer(11), notnull: true}
- dm_record_permission_association_id: {type: integer(11), notnull: true}
- relations:
- Association:
- class: DmRecordPermissionAssociation
- local: dm_record_permission_association_id
- onDelete: CASCADE
- foreignAlias: RecordsPermissionsAssociations
- User:
- class: DmUser
- local: dm_user_id
- onDelete: CASCADE
- foreignAlias: RecordsPermissionsAssociations
- ## Records Permissions Associations
- DmRememberKey:
- actAs:
- Timestampable:
- updated:
- disabled: true
- options:
- symfony:
- form: false
- filter: false
- columns:
- dm_user_id:
- type: integer
- remember_key: string(32)
- ip_address:
- type: string(50)
- primary: true
- relations:
- User:
- class: DmUser
- local: dm_user_id
- foreignAlias: RememberKeys
- foreignType: one
- onDelete: CASCADE
- //generated base dmuser class:
- <?php
- /**
- * BaseDmUser
- *
- * This class has been auto-generated by the Doctrine ORM Framework
- *
- * @property string $username
- * @property string $email
- * @property string $algorithm
- * @property string $salt
- * @property string $password
- * @property boolean $is_active
- * @property boolean $is_super_admin
- * @property timestamp $last_login
- * @property string $forgot_password_code
- * @property Doctrine_Collection $Groups
- * @property Doctrine_Collection $Permissions
- * @property Doctrine_Collection $Records
- * @property Doctrine_Collection $RecordsPermissionsAssociations
- * @property Doctrine_Collection $DmLock
- * @property DmRememberKey $RememberKeys
- *
- * @method string getUsername() Returns the current record's "username" value
- * @method string getEmail() Returns the current record's "email" value
- * @method string getAlgorithm() Returns the current record's "algorithm" value
- * @method string getSalt() Returns the current record's "salt" value
- * @method string getPassword() Returns the current record's "password" value
- * @method boolean getIsActive() Returns the current record's "is_active" value
- * @method boolean getIsSuperAdmin() Returns the current record's "is_super_admin" value
- * @method timestamp getLastLogin() Returns the current record's "last_login" value
- * @method string getForgotPasswordCode() Returns the current record's "forgot_password_code" value
- * @method Doctrine_Collection getGroups() Returns the current record's "Groups" collection
- * @method Doctrine_Collection getPermissions() Returns the current record's "Permissions" collection
- * @method Doctrine_Collection getRecords() Returns the current record's "Records" collection
- * @method Doctrine_Collection getRecordsPermissionsAssociations() Returns the current record's "RecordsPermissionsAssociations" collection
- * @method Doctrine_Collection getDmLock() Returns the current record's "DmLock" collection
- * @method DmRememberKey getRememberKeys() Returns the current record's "RememberKeys" value
- * @method DmUser setUsername() Sets the current record's "username" value
- * @method DmUser setEmail() Sets the current record's "email" value
- * @method DmUser setAlgorithm() Sets the current record's "algorithm" value
- * @method DmUser setSalt() Sets the current record's "salt" value
- * @method DmUser setPassword() Sets the current record's "password" value
- * @method DmUser setIsActive() Sets the current record's "is_active" value
- * @method DmUser setIsSuperAdmin() Sets the current record's "is_super_admin" value
- * @method DmUser setLastLogin() Sets the current record's "last_login" value
- * @method DmUser setForgotPasswordCode() Sets the current record's "forgot_password_code" value
- * @method DmUser setGroups() Sets the current record's "Groups" collection
- * @method DmUser setPermissions() Sets the current record's "Permissions" collection
- * @method DmUser setRecords() Sets the current record's "Records" collection
- * @method DmUser setRecordsPermissionsAssociations() Sets the current record's "RecordsPermissionsAssociations" collection
- * @method DmUser setDmLock() Sets the current record's "DmLock" collection
- * @method DmUser setRememberKeys() Sets the current record's "RememberKeys" value
- *
- * @package test
- * @subpackage model
- * @author Your name here
- * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
- */
- abstract class BaseDmUser extends myDoctrineRecord
- {
- public function setTableDefinition()
- {
- $this->setTableName('dm_user');
- $this->hasColumn('username', 'string', 255, array(
- 'type' => 'string',
- 'notnull' => true,
- 'unique' => true,
- 'length' => 255,
- ));
- $this->hasColumn('email', 'string', 255, array(
- 'type' => 'string',
- 'notnull' => true,
- 'unique' => true,
- 'length' => 255,
- ));
- $this->hasColumn('algorithm', 'string', 128, array(
- 'type' => 'string',
- 'default' => 'sha1',
- 'notnull' => true,
- 'length' => 128,
- ));
- $this->hasColumn('salt', 'string', 128, array(
- 'type' => 'string',
- 'length' => 128,
- ));
- $this->hasColumn('password', 'string', 128, array(
- 'type' => 'string',
- 'length' => 128,
- ));
- $this->hasColumn('is_active', 'boolean', null, array(
- 'type' => 'boolean',
- 'default' => true,
- ));
- $this->hasColumn('is_super_admin', 'boolean', null, array(
- 'type' => 'boolean',
- 'default' => false,
- ));
- $this->hasColumn('last_login', 'timestamp', null, array(
- 'type' => 'timestamp',
- ));
- $this->hasColumn('forgot_password_code', 'string', 12, array(
- 'type' => 'string',
- 'unique' => true,
- 'length' => 12,
- ));
- $this->index('is_active_idx', array(
- 'fields' =>
- array(
- 0 => 'is_active',
- ),
- ));
- }
- public function setUp()
- {
- parent::setUp();
- $this->hasMany('DmGroup as Groups', array(
- 'refClass' => 'DmUserGroup',
- 'local' => 'dm_user_id',
- 'foreign' => 'dm_group_id'));
- $this->hasMany('DmPermission as Permissions', array(
- 'refClass' => 'DmUserPermission',
- 'local' => 'dm_user_id',
- 'foreign' => 'dm_permission_id'));
- $this->hasMany('DmRecordPermission as Records', array(
- 'refClass' => 'DmRecordPermissionUser',
- 'local' => 'dm_user_id',
- 'foreign' => 'dm_record_permission_id'));
- $this->hasMany('DmRecordPermissionAssociation as RecordsPermissionsAssociations', array(
- 'refClass' => 'DmRecordPermissionAssociationUser',
- 'local' => 'dm_user_id',
- 'foreign' => 'dm_record_permission_association_id'));
- $this->hasMany('DmLock', array(
- 'local' => 'id',
- 'foreign' => 'user_id'));
- $this->hasOne('DmRememberKey as RememberKeys', array(
- 'local' => 'id',
- 'foreign' => 'dm_user_id'));
- $timestampable0 = new Doctrine_Template_Timestampable(array(
- ));
- $this->actAs($timestampable0);
- }
- }
- //there are no more useless relations ! =)
- //but they are generated on the fly by Doctrine_RElation_Parser @ line 176 !
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement