00001 <?php
00002
00003
00004
00005
00006
00007
00008 class DAOConfirmations extends DataObjectBase
00009 {
00010 public $id;
00011 public $id_item;
00012 public $code;
00013 public $data;
00014 public $action;
00015 public $expirationdate;
00016
00017 protected function create_table_object() {
00018 return new DBTable(
00019 'confirmations',
00020 array(
00021 new DBFieldInt('id', null, DBFieldInt::AUTOINCREMENT | DBFieldInt::UNSIGNED | DBFieldInt::NOT_NULL),
00022 new DBFieldInt('id_item', null, DBFieldInt::UNSIGNED | DBFieldInt::NOT_NULL),
00023 new DBFieldText('code', 50, null, DBFieldText::NOT_NULL),
00024 new DBFieldSerialized('data', DBFieldText::BLOB_LENGTH_SMALL),
00025 new DBFieldText('action', 20, null, DBFieldText::NOT_NULL),
00026 new DBFieldDateTime('expirationdate', null, DBFieldDateTime::NOT_NULL),
00027 ),
00028 'id'
00029 );
00030 }
00031
00032
00033
00034
00035
00036
00037 public function create_handler() {
00038 Load::classes_in_directory('behaviour/confirmationhandlers', $this->action, 'confirmationhandler', false);
00039 $cls = Load::filename_to_classname($this->action, 'ConfirmationHandler');
00040 if (class_exists($cls)) {
00041 return new $cls($this);
00042 }
00043
00044 return new ConfirmationHandlerBase(false);
00045 }
00046 }