public function generate()
 {
     $validateFieldResult = true;
     $post = Yii::$app->request->post('Generator', []);
     $originTablePOST = ['Generator' => isset($post['originTable']) ? $post['originTable'] : null];
     $translateTablePOST = ['Generator' => isset($post['translateTable']) ? $post['translateTable'] : null];
     if (sizeof($_POST) && $this->load(Yii::$app->request->post()) && $this->originTable->load($originTablePOST) && $this->translateTable->load($translateTablePOST)) {
         $this->originTable->autoCreateTable = $this->translateTable->autoCreateTable = $this->autoCreateTable;
         $this->originTable->migrationCreate = $this->translateTable->migrationCreate = $this->createMigration;
         $this->originTable->dropIfExists = $this->translateTable->dropIfExists = $this->dropIfExists;
         $filesList = [];
         if ($files = $this->originTable->generate()) {
             foreach ($files as $key => $_next) {
                 $filesList[] = $_next;
             }
         }
         if ($files = $this->translateTable->generate()) {
             foreach ($files as $key => $_next) {
                 $filesList[] = $_next;
             }
         }
         return $filesList;
     }
     return [];
 }
 public function beforeValidate()
 {
     $options = ArrayHelper::merge($this->tableBuilder, ['tableNameRequired' => $this->createTable, 'autoCreateTable' => $this->createTable]);
     $this->tableBuilder = new TableGenerator($options);
     $this->tableBuilder->forceTableCreate = $this->createTable = false;
     $result = $this->tableBuilder->validate() && parent::beforeValidate();
     if (!$result) {
         foreach ($this->behaviorModels as &$behaviorModel) {
             if (is_array($behaviorModel)) {
                 $behaviorModel = new Behaviors($behaviorModel);
             }
         }
     } else {
         $this->tableBuilder->tableName = $this->tableBuilder->tableName ?: $this->tableName;
         $this->files = $this->tableBuilder->generate();
     }
     return $result;
 }