diff --git a/models/Email.php b/models/Email.php index 0ba31194e..fa3cac123 100644 --- a/models/Email.php +++ b/models/Email.php @@ -5,4 +5,6 @@ class Email extends Doctrine_Record { $this->hasColumn('address', 'string', 150, 'email|unique'); } + + } diff --git a/models/gnatUser.php b/models/gnatUser.php new file mode 100644 index 000000000..ef8f66530 --- /dev/null +++ b/models/gnatUser.php @@ -0,0 +1,20 @@ +<?php + +class gnatUserTable { } + +class gnatUser extends Doctrine_Record +{ + public function setTableDefinition() + { + $this->hasColumn('name', 'string', 150); + $this->hasColumn('email_id', 'integer', 10, array ( 'unique' => true,)); + } + + public function setUp() + { + parent::setUp(); + $this->ownsOne('Email', array('local'=>'email_id','foreign'=>'id','onDelete'=>'CASCADE')); + } + +} +