示例#1
0
 /**
  * Install registries table
  *
  * @static
  * @access  protected
  * @return  void
  */
 public static function generate($table_name = null)
 {
     $table_name or $table_name = \Config::get('hybrid.tables.registry', 'options');
     $class_name = \Inflector::classify($table_name, true);
     if ('y' === \Cli::prompt("Would you like to install `registry.{$table_name}` table?", array('y', 'n'))) {
         Generate::migration(array('create_' . $table_name, 'name:string[255]', 'value:longtext'));
         Generate::$create_files = array();
     }
 }
示例#2
0
 /**
  * Execute all available migration
  *
  * @static
  * @access  protected
  * @return  void
  */
 protected static function execute()
 {
     if (empty(static::$queries)) {
         \Cli::write("Nothing to generate", "red");
     } elseif ('y' === \Cli::prompt("Confirm Generate Model and Migration?", array('y', 'n'))) {
         foreach (static::$queries as $data) {
             Generate::model($data);
             Generate::$create_files = array();
         }
     }
 }