00001 <?php
00002
00003
00004
00005
00006
00007
00008 class DAOCoursesTest extends DataObjectBase {
00009 public $id;
00010 public $id_room;
00011 public $id_teacher;
00012 public $title;
00013 public $description;
00014
00015 protected function create_table_object() {
00016 return new DBTable(
00017 'coursestest',
00018 array(
00019 new DBFieldInt('id', null, DBFieldInt::AUTOINCREMENT | DBFieldInt::UNSIGNED | DBFieldInt::NOT_NULL),
00020 new DBFieldInt('id_room', null, DBFieldInt::UNSIGNED | DBFieldInt::NOT_NULL),
00021 new DBFieldInt('id_teacher', null, DBFieldInt::UNSIGNED | DBFieldInt::NOT_NULL),
00022 new DBFieldText('title', 100, null, DBField::NOT_NULL),
00023 new DBFieldText('description', DBFieldText::BLOB_LENGTH_SMALL, DBField::NOT_NULL)
00024 ),
00025 'id',
00026 array(
00027 new DBRelation(
00028 'roomstest',
00029 new DBFieldRelation('id_room', 'id')
00030 ),
00031 new DBRelation(
00032 'teacherstest',
00033 new DBFieldRelation('id_teacher', 'id')
00034 )
00035 ),
00036 null,
00037 new DBDriverMySqlMock()
00038 );
00039 }
00040 }