generateTable() публичный Метод

Takes a table name and $fields array and returns a completed, escaped variable declaration to be used in schema classes.
public generateTable ( string $table, array $fields ) : string
$table string Table name you want returned.
$fields array Array of field information to generate the table with.
Результат string Variable declaration for a schema class.
Пример #1
0
 /**
  * Generates a string representation of a schema.
  *
  * @param array $tableInfo Table schema array
  * @return string fields definitions
  */
 protected function _generateSchema($tableInfo)
 {
     $schema = trim($this->_Schema->generateTable('f', $tableInfo), "\n");
     return substr($schema, 13, -1);
 }
Пример #2
0
 /**
  * Generates a string representation of a schema.
  *
  * @param array $tableInfo Table schema array
  * @return string fields definitions
  */
 protected function _generateSchema($tableInfo)
 {
     $schema = $this->_Schema->generateTable('f', $tableInfo);
     return substr($schema, 10, -2);
 }