<?php
 namespace VnChocola\Model;
 use TCMS\Model;
 use TCMS\FieldModel;
 use FIELD_DATA_TYPE;
 class CarsInfoModel extends Model {
 public $tableName = 'Cars_Info';
 public $timestamp = true;
 public function registerField() {
 $this->addField('id', FIELD_DATA_TYPE::STRING);
 $this->addField('code',FIELD_DATA_TYPE::INTEGER);
 $this->addField('name', FIELD_DATA_TYPE::STRING);
 $this->addField('model', FIELD_DATA_TYPE::STRING);
 $this->addField('color', FIELD_DATA_TYPE::STRING);
 $this->addField('color_code', FIELD_DATA_TYPE::STRING);
 $this->addField('type', FIELD_DATA_TYPE::STRING);
 $this->addField('km', FIELD_DATA_TYPE::STRING);
 $this->addField('old_km', FIELD_DATA_TYPE::STRING);
 $this->addField('plate', FIELD_DATA_TYPE::STRING, function(FieldModel $field) {
 $field->required = true;
 }
);
 $this->addField('customerID', FIELD_DATA_TYPE::STRING, function(FieldModel $field) {
 $field->required = true;
 }
);
 $this->addField('search_plate', FIELD_DATA_TYPE::STRING);
 $this->addField('vin', FIELD_DATA_TYPE::STRING);
 $this->addField('frames', FIELD_DATA_TYPE::STRING);
 $this->addField('engineNo', FIELD_DATA_TYPE::STRING);
 $this->addField('cmCode', FIELD_DATA_TYPE::STRING);
 $this->addField('cfCode', FIELD_DATA_TYPE::STRING);
 $this->addField('cfName', FIELD_DATA_TYPE::STRING);
 }
 }
