<?php
 namespace VnChocola\Model;
 use TCMS\Model;
 use TCMS\FieldModel;
 use FIELD_DATA_TYPE;
 class NewCarsModel extends Model {
 public $tableName = 'Newcars';
 public function registerField() {
 $this->addField('id', FIELD_DATA_TYPE::STRING);
 $this->addField('carID', FIELD_DATA_TYPE::STRING, function(FieldModel $field) {
 $field->required = true;
 }
);
 $this->addField('HotCustomerID', FIELD_DATA_TYPE::STRING, function(FieldModel $field) {
 $field->required = true;
 }
);
 $this->addField('carModel', FIELD_DATA_TYPE::STRING);
 $this->addField('color', FIELD_DATA_TYPE::STRING);
 $this->addField('type', FIELD_DATA_TYPE::STRING);
 $this->addField('amount', FIELD_DATA_TYPE::INTEGER,function(FieldModel $field){
 $field->require = true;
 }
);
 $this->addField('purposeOfUse',FIELD_DATA_TYPE::STRING);
 $this->addField('deliveryDate', FIELD_DATA_TYPE::DATE,function(FieldModel $field){
 $field->require = true;
 $field->format = lang('time.dateFormat');
 $field->autoFormat = true;
 }
);
 $this->addField('note', FIELD_DATA_TYPE::STRING);
 }
 }
