Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.24 KB | None | 0 0
  1. //corrected schema
  2. DmUser:
  3. actAs: [Timestampable]
  4. columns:
  5. username:
  6. type: string(255)
  7. notnull: true
  8. unique: true
  9. email:
  10. type: string(255)
  11. notnull: true
  12. unique: true
  13. algorithm:
  14. type: string(128)
  15. default: sha1
  16. notnull: true
  17. salt: string(128)
  18. password: string(128)
  19. is_active:
  20. type: boolean
  21. default: true
  22. is_super_admin:
  23. type: boolean
  24. default: false
  25. last_login:
  26. type: timestamp
  27. forgot_password_code:
  28. type: string(12)
  29. unique: true
  30. indexes:
  31. is_active_idx:
  32. fields: [is_active]
  33. relations:
  34. Groups:
  35. class: DmGroup
  36. local: dm_user_id
  37. foreign: dm_group_id
  38. refClass: DmUserGroup
  39. foreignAlias: Users
  40. Permissions:
  41. class: DmPermission
  42. local: dm_user_id
  43. foreign: dm_permission_id
  44. refClass: DmUserPermission
  45. foreignAlias: Users
  46. Records:
  47. class: DmRecordPermission
  48. local: dm_user_id
  49. foreign: dm_record_permission_id
  50. refClass: DmRecordPermissionUser
  51. foreignAlias: Users
  52. RecordsPermissionsAssociations:
  53. class: DmRecordPermissionAssociation
  54. refClass: DmRecordPermissionAssociationUser
  55. local: dm_user_id
  56. foreign: dm_record_permission_association_id
  57. foreignAlias: Users
  58.  
  59. DmRecordPermissionUser:
  60. options:
  61. symfony:
  62. form: false
  63. filter: false
  64. columns:
  65. dm_user_id: {type: integer(11), notnull: true, primary: true}
  66. dm_record_permission_id: {type: integer(11), notnull: true, primary: true}
  67. relations:
  68. User:
  69. class: DmUser
  70. local: dm_user_id
  71. onDelete: CASCADE
  72. foreignAlias: Records
  73. Record:
  74. class: DmRecordPermission
  75. local: dm_record_permission_id
  76. onDelete: CASCADE
  77. foreignAlias: Users
  78.  
  79. DmGroup:
  80. actAs: [Timestampable]
  81. columns:
  82. name:
  83. type: string(255)
  84. unique: true
  85. description: string(1000)
  86. relations:
  87. Users:
  88. class: DmUser
  89. refClass: DmUserGroup
  90. local: dm_group_id
  91. foreign: dm_user_id
  92. foreignAlias: Groups
  93. Permissions:
  94. class: DmPermission
  95. local: dm_group_id
  96. foreign: dm_permission_id
  97. refClass: DmGroupPermission
  98. foreignAlias: Groups
  99. Records:
  100. class: DmRecordPermission
  101. local: dm_group_id
  102. foreign: dm_record_permission_id
  103. refClass: DmRecordPermissionGroup
  104. foreignAlias: Groups
  105. RecordsPermissionsAssociations:
  106. class: DmRecordPermissionAssociation
  107. refClass: DmRecordPermissionAssociationGroup
  108. local: dm_group_id
  109. foreign: dm_record_permission_association_id
  110. foreignAlias: Groups
  111.  
  112. DmRecordPermissionGroup:
  113. options:
  114. symfony:
  115. form: false
  116. filter: false
  117. columns:
  118. dm_group_id: {type: integer(11), notnull: true, primary: true}
  119. dm_record_permission_id: {type: integer(11), notnull: true, primary: true}
  120. relations:
  121. Group:
  122. class: DmGroup
  123. local: dm_group_id
  124. onDelete: CASCADE
  125. foreignAlias: Records
  126. Record:
  127. class: DmRecordPermission
  128. local: dm_record_permission_id
  129. onDelete: CASCADE
  130. foreignAlias: Groups
  131.  
  132. DmPermission:
  133. actAs: [Timestampable]
  134. columns:
  135. name:
  136. type: string(255)
  137. unique: true
  138. description: string(5000)
  139.  
  140. DmGroupPermission:
  141. options:
  142. symfony:
  143. form: false
  144. filter: false
  145. columns:
  146. dm_group_id:
  147. type: integer
  148. primary: true
  149. dm_permission_id:
  150. type: integer
  151. primary: true
  152. relations:
  153. Group:
  154. class: DmGroup
  155. local: dm_group_id
  156. onDelete: CASCADE
  157. foreignAlias: Permissions
  158. Permission:
  159. class: DmPermission
  160. local: dm_permission_id
  161. onDelete: CASCADE
  162. foreignAlias: Groups
  163.  
  164. DmUserPermission:
  165. options:
  166. symfony:
  167. form: false
  168. filter: false
  169. columns:
  170. dm_user_id:
  171. type: integer
  172. primary: true
  173. dm_permission_id:
  174. type: integer
  175. primary: true
  176. relations:
  177. User:
  178. class: DmUser
  179. local: dm_user_id
  180. onDelete: CASCADE
  181. foreignAlias: Permissions
  182. Permission:
  183. class: DmPermission
  184. local: dm_permission_id
  185. onDelete: CASCADE
  186. foreignAlias: Users
  187.  
  188. DmUserGroup:
  189. options:
  190. symfony:
  191. form: false
  192. filter: false
  193. columns:
  194. dm_user_id:
  195. type: integer
  196. primary: true
  197. dm_group_id:
  198. type: integer
  199. primary: true
  200. relations:
  201. User:
  202. class: DmUser
  203. local: dm_user_id
  204. onDelete: CASCADE
  205. foreignAlias: Groups
  206. Group:
  207. class: DmGroup
  208. local: dm_group_id
  209. onDelete: CASCADE
  210. foreignAlias: Users
  211.  
  212. DmRecordPermission:
  213. columns:
  214. secure_module: {type: string(255), notnull: true}
  215. secure_action: {type: string(255), notnull: true}
  216. secure_model: {type: string(255), notnull: true}
  217. secure_record: {type: integer(14), notnull: true}
  218. description: string(1000)
  219. relations:
  220. Users:
  221. class: DmUser
  222. local: dm_record_permission_id
  223. foreign: dm_user_id
  224. refClass: DmRecordPermissionUser
  225. foreignAlias: RecordsPermissions
  226. Groups:
  227. class: DmGroup
  228. local: dm_record_permission_id
  229. foreign: dm_group_id
  230. refClass: DmRecordPermissionGroup
  231. foreignAlias: RecordsPermissions
  232. indexes:
  233. #idx_secure_module_action_model:
  234.  
  235. ## Records Permissions Associations
  236.  
  237. DmRecordPermissionAssociation:
  238. columns:
  239. dm_secure_action:
  240. type: string(255)
  241. dm_secure_module:
  242. type: string(255)
  243. dm_secure_model:
  244. type: string(255)
  245. relations:
  246. Groups:
  247. class: DmGroup
  248. refClass: DmRecordPermissionAssociationGroup
  249. local: dm_record_permission_association_id
  250. foreign: dm_group_id
  251. foreignAlias: RecordsPermissionsAssociations
  252. Users:
  253. class: DmUser
  254. refClass: DmRecordPermissionAssociationUser
  255. local: dm_record_permission_association_id
  256. foreign: dm_user_id
  257. foreignAlias: RecordsPermissionsAssociations
  258.  
  259. DmRecordPermissionAssociationGroup:
  260. options:
  261. symfony:
  262. form: false
  263. filter: false
  264. columns:
  265. dm_group_id: { type: integer(11), notnull: true}
  266. dm_record_permission_association_id: {type: integer(11), notnull: true}
  267. relations:
  268. Association:
  269. class: DmRecordPermissionAssociation
  270. local: dm_record_permission_association_id
  271. onDelete: CASCADE
  272. foreignAlias: Groups
  273. Group:
  274. class: DmGroup
  275. local: dm_group_id
  276. onDelete: CASCADE
  277. foreignAlias: RecordsPermissionsAssociation
  278.  
  279. DmRecordPermissionAssociationUser:
  280. options:
  281. symfony:
  282. form: false
  283. filter: false
  284. columns:
  285. dm_user_id: {type: integer(11), notnull: true}
  286. dm_record_permission_association_id: {type: integer(11), notnull: true}
  287. relations:
  288. Association:
  289. class: DmRecordPermissionAssociation
  290. local: dm_record_permission_association_id
  291. onDelete: CASCADE
  292. foreignAlias: RecordsPermissionsAssociations
  293. User:
  294. class: DmUser
  295. local: dm_user_id
  296. onDelete: CASCADE
  297. foreignAlias: RecordsPermissionsAssociations
  298.  
  299. ## Records Permissions Associations
  300.  
  301.  
  302.  
  303. DmRememberKey:
  304. actAs:
  305. Timestampable:
  306. updated:
  307. disabled: true
  308. options:
  309. symfony:
  310. form: false
  311. filter: false
  312. columns:
  313. dm_user_id:
  314. type: integer
  315. remember_key: string(32)
  316. ip_address:
  317. type: string(50)
  318. primary: true
  319. relations:
  320. User:
  321. class: DmUser
  322. local: dm_user_id
  323. foreignAlias: RememberKeys
  324. foreignType: one
  325. onDelete: CASCADE
  326.  
  327.  
  328. //generated base dmuser class:
  329.  
  330. <?php
  331.  
  332. /**
  333. * BaseDmUser
  334. *
  335. * This class has been auto-generated by the Doctrine ORM Framework
  336. *
  337. * @property string $username
  338. * @property string $email
  339. * @property string $algorithm
  340. * @property string $salt
  341. * @property string $password
  342. * @property boolean $is_active
  343. * @property boolean $is_super_admin
  344. * @property timestamp $last_login
  345. * @property string $forgot_password_code
  346. * @property Doctrine_Collection $Groups
  347. * @property Doctrine_Collection $Permissions
  348. * @property Doctrine_Collection $Records
  349. * @property Doctrine_Collection $RecordsPermissionsAssociations
  350. * @property Doctrine_Collection $DmLock
  351. * @property DmRememberKey $RememberKeys
  352. *
  353. * @method string getUsername() Returns the current record's "username" value
  354. * @method string getEmail() Returns the current record's "email" value
  355. * @method string getAlgorithm() Returns the current record's "algorithm" value
  356. * @method string getSalt() Returns the current record's "salt" value
  357. * @method string getPassword() Returns the current record's "password" value
  358. * @method boolean getIsActive() Returns the current record's "is_active" value
  359. * @method boolean getIsSuperAdmin() Returns the current record's "is_super_admin" value
  360. * @method timestamp getLastLogin() Returns the current record's "last_login" value
  361. * @method string getForgotPasswordCode() Returns the current record's "forgot_password_code" value
  362. * @method Doctrine_Collection getGroups() Returns the current record's "Groups" collection
  363. * @method Doctrine_Collection getPermissions() Returns the current record's "Permissions" collection
  364. * @method Doctrine_Collection getRecords() Returns the current record's "Records" collection
  365. * @method Doctrine_Collection getRecordsPermissionsAssociations() Returns the current record's "RecordsPermissionsAssociations" collection
  366. * @method Doctrine_Collection getDmLock() Returns the current record's "DmLock" collection
  367. * @method DmRememberKey getRememberKeys() Returns the current record's "RememberKeys" value
  368. * @method DmUser setUsername() Sets the current record's "username" value
  369. * @method DmUser setEmail() Sets the current record's "email" value
  370. * @method DmUser setAlgorithm() Sets the current record's "algorithm" value
  371. * @method DmUser setSalt() Sets the current record's "salt" value
  372. * @method DmUser setPassword() Sets the current record's "password" value
  373. * @method DmUser setIsActive() Sets the current record's "is_active" value
  374. * @method DmUser setIsSuperAdmin() Sets the current record's "is_super_admin" value
  375. * @method DmUser setLastLogin() Sets the current record's "last_login" value
  376. * @method DmUser setForgotPasswordCode() Sets the current record's "forgot_password_code" value
  377. * @method DmUser setGroups() Sets the current record's "Groups" collection
  378. * @method DmUser setPermissions() Sets the current record's "Permissions" collection
  379. * @method DmUser setRecords() Sets the current record's "Records" collection
  380. * @method DmUser setRecordsPermissionsAssociations() Sets the current record's "RecordsPermissionsAssociations" collection
  381. * @method DmUser setDmLock() Sets the current record's "DmLock" collection
  382. * @method DmUser setRememberKeys() Sets the current record's "RememberKeys" value
  383. *
  384. * @package test
  385. * @subpackage model
  386. * @author Your name here
  387. * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
  388. */
  389. abstract class BaseDmUser extends myDoctrineRecord
  390. {
  391. public function setTableDefinition()
  392. {
  393. $this->setTableName('dm_user');
  394. $this->hasColumn('username', 'string', 255, array(
  395. 'type' => 'string',
  396. 'notnull' => true,
  397. 'unique' => true,
  398. 'length' => 255,
  399. ));
  400. $this->hasColumn('email', 'string', 255, array(
  401. 'type' => 'string',
  402. 'notnull' => true,
  403. 'unique' => true,
  404. 'length' => 255,
  405. ));
  406. $this->hasColumn('algorithm', 'string', 128, array(
  407. 'type' => 'string',
  408. 'default' => 'sha1',
  409. 'notnull' => true,
  410. 'length' => 128,
  411. ));
  412. $this->hasColumn('salt', 'string', 128, array(
  413. 'type' => 'string',
  414. 'length' => 128,
  415. ));
  416. $this->hasColumn('password', 'string', 128, array(
  417. 'type' => 'string',
  418. 'length' => 128,
  419. ));
  420. $this->hasColumn('is_active', 'boolean', null, array(
  421. 'type' => 'boolean',
  422. 'default' => true,
  423. ));
  424. $this->hasColumn('is_super_admin', 'boolean', null, array(
  425. 'type' => 'boolean',
  426. 'default' => false,
  427. ));
  428. $this->hasColumn('last_login', 'timestamp', null, array(
  429. 'type' => 'timestamp',
  430. ));
  431. $this->hasColumn('forgot_password_code', 'string', 12, array(
  432. 'type' => 'string',
  433. 'unique' => true,
  434. 'length' => 12,
  435. ));
  436.  
  437.  
  438. $this->index('is_active_idx', array(
  439. 'fields' =>
  440. array(
  441. 0 => 'is_active',
  442. ),
  443. ));
  444. }
  445.  
  446. public function setUp()
  447. {
  448. parent::setUp();
  449. $this->hasMany('DmGroup as Groups', array(
  450. 'refClass' => 'DmUserGroup',
  451. 'local' => 'dm_user_id',
  452. 'foreign' => 'dm_group_id'));
  453.  
  454. $this->hasMany('DmPermission as Permissions', array(
  455. 'refClass' => 'DmUserPermission',
  456. 'local' => 'dm_user_id',
  457. 'foreign' => 'dm_permission_id'));
  458.  
  459. $this->hasMany('DmRecordPermission as Records', array(
  460. 'refClass' => 'DmRecordPermissionUser',
  461. 'local' => 'dm_user_id',
  462. 'foreign' => 'dm_record_permission_id'));
  463.  
  464. $this->hasMany('DmRecordPermissionAssociation as RecordsPermissionsAssociations', array(
  465. 'refClass' => 'DmRecordPermissionAssociationUser',
  466. 'local' => 'dm_user_id',
  467. 'foreign' => 'dm_record_permission_association_id'));
  468.  
  469. $this->hasMany('DmLock', array(
  470. 'local' => 'id',
  471. 'foreign' => 'user_id'));
  472.  
  473. $this->hasOne('DmRememberKey as RememberKeys', array(
  474. 'local' => 'id',
  475. 'foreign' => 'dm_user_id'));
  476.  
  477. $timestampable0 = new Doctrine_Template_Timestampable(array(
  478. ));
  479. $this->actAs($timestampable0);
  480. }
  481. }
  482.  
  483. //there are no more useless relations ! =)
  484. //but they are generated on the fly by Doctrine_RElation_Parser @ line 176 !
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement