2016-07-15 3 views

ответ

0

Вы можете использовать $customer_model->getTableSchema() или Customer::getTableSchema()

Предоставляет вам что-то вроде этого:

 
yii\db\TableSchema#1 (
    [schemaName] => null 
    [name] => 'customers' 
    [fullName] => 'customers' 
    [primaryKey] => [ 
     0 => 'customerID' 
    ] 
    [sequenceName] => '' 
    [foreignKeys] => [ 
     0 => [ 
      0 => 'orders' 
      'ord_customerID' => 'customerID' 
     ] 
    ] 
    [columns] => [ 
     'customerID' => yii\db\ColumnSchema#2 (
      [name] => 'customerID' 
      [allowNull] => false 
      [type] => 'integer' 
      [phpType] => 'integer' 
      [dbType] => 'int(10) unsigned' 
      [defaultValue] => null 
      [enumValues] => null 
      [size] => 10 
      [precision] => 10 
      [scale] => null 
      [isPrimaryKey] => true 
      [autoIncrement] => true 
      [unsigned] => true 
      [comment] => '' 
     ) 
    ...