<?php
 namespace VnChocola\Model;
 use TCMS\Model;
 use TCMS\FieldModel;
 use FIELD_DATA_TYPE;
 class SchedulerModel extends Model {
 public $tableName = 'Schedulers';
 public $timestamp = true;
 public function registerField() {
 $this->addField('id', FIELD_DATA_TYPE::STRING);
 $this->addField('title', FIELD_DATA_TYPE::STRING);
 $this->addField('content', FIELD_DATA_TYPE::STRING);
 $this->addField('fromDateTime', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->required = true;
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 }
);
 $this->addField('toDateTime', FIELD_DATA_TYPE::DATETIME, function(FieldModel $field) {
 $field->required = true;
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 }
);
 $this->addField('staffID', FIELD_DATA_TYPE::STRING, function(FieldModel $field) {
 $field->required = true;
 }
);
 $this->addField('branchID', FIELD_DATA_TYPE::STRING);
 $this->addField('allDay', FIELD_DATA_TYPE::BOOLEAN);
 $this->addField('recurrenceRule', FIELD_DATA_TYPE::STRING);
 }
 }
