Guest User

Untitled

a guest
Mar 9th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. User:
  2. tableName: user
  3. className: User
  4. columns:
  5. id:
  6. notnull: true
  7. primary: true
  8. autoincrement: true
  9. type: integer
  10. length: 11
  11. client_id:
  12. notnull: true
  13. type: integer
  14. length: 11
  15. name: id
  16. first_name:
  17. type: string
  18. length: 31
  19. middle_name:
  20. default: NULL
  21. notnull: false
  22. type: string
  23. length: 31
  24. last_name:
  25. type: string
  26. length: 31
  27. username:
  28. type: string
  29. length: 31
  30. password:
  31. type: string
  32. length: 255
  33. email:
  34. type: string
  35. length: 127
  36. relations:
  37. Client:
  38. local: client_id
  39. foreign: id
  40. actAs:
  41. NestedSet:
  42. hasManyRoots: true
  43. rootColumnName: root_id
  44.  
  45.  
  46.  
  47.  
  48. public function setTableDefinition()
  49. {
  50. $this->setTableName('user');
  51. $this->hasColumn('id', 'integer', 11, array('notnull' => true));
  52.  
  53. $this->hasColumn('client_id', 'integer', 11, array('notnull' => true));
  54.  
  55. $this->hasColumn('first_name', 'string', 31);
  56.  
  57. $this->hasColumn('middle_name', 'string', 31);
  58.  
  59. $this->hasColumn('last_name', 'string', 31);
  60.  
  61. $this->hasColumn('username', 'string', 31);
  62.  
  63. $this->hasColumn('password', 'string', 255);
  64. $this->hasColumn('email', 'string', 127);
  65.  
  66.  
  67.  
  68.  
  69. $this->actAs('NestedSet', array (
  70. 'hasManyRoots' => true,
  71. 'rootColumnName' => 'root_id',
  72. ));
  73.  
  74. }
Add Comment
Please, Sign In to add comment