Guest User

Untitled

a guest
Jul 20th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. class Auth_Usuario_Funcao extends Doctrine_Record {
  2.  
  3. public function setTableDefinition() {
  4.  
  5. $this->setTableName('auth_usuarios_funcoes');
  6.  
  7. $this->hasColumn('id', 'integer', null, array('primary', 'sequence' => 'SEQ_AUTH_USUARIOS_FUNCOES'));
  8. $this->hasColumn('auth_usuario_id', 'integer', null, array(
  9. 'primary' => true));
  10. $this->hasColumn('auth_funcao_id', 'integer', null, array(
  11. 'primary' => true));
  12.  
  13. }
  14.  
  15. }
  16.  
  17. class Auth_Usuario extends Doctrine_Record {
  18.  
  19. public function setTableDefinition() {
  20. $this->setTableName('auth_usuarios');
  21.  
  22. $this->hasColumn('id', 'integer', null, array('primary', 'sequence' => 'SEQ_AUTH_USUARIOS'));
  23. $this->hasColumn('usuario', 'string', 150, array(
  24. 'unique' => 'true'
  25. ));
  26. $this->hasColumn('senha', 'string', 150);
  27. $this->hasColumn('estaAtivo', 'integer', 1);
  28. }
  29.  
  30. public function setUp() {
  31. $this->hasMany('Auth_Funcao as Funcoes', array(
  32. 'local' => 'auth_usuario_id',
  33. 'foreign' => 'auth_funcao_id',
  34. 'refClass' => 'Auth_Usuario_Funcao'
  35. )
  36. );
  37. }
  38.  
  39. }
  40.  
  41. class Auth_Funcao extends Doctrine_Record {
  42.  
  43. public function setTableDefinition() {
  44.  
  45. $this->setTableName('auth_funcoes');
  46.  
  47. $this->hasColumn('id', 'integer', null, array('primary', 'sequence' => 'SEQ_AUTH_FUNCOES'));
  48. $this->hasColumn('nome', 'string', 150);
  49. $this->hasColumn('descricao', 'string');
  50. $this->hasColumn('importancia', 'integer', 11);
  51.  
  52. }
  53. public function setUp() {
  54.  
  55. $this->hasMany('Auth_Usuario as Usuarios', array(
  56. 'local' => 'auth_funcao_id',
  57. 'foreign' => 'auth_usuario_id',
  58. 'refClass' => 'Auth_Usuario_Funcao'
  59. )
  60. )
  61.  
  62. }
  63.  
  64. }
Add Comment
Please, Sign In to add comment