/** * {@inheritdoc} */ public static function getConfigSchema() { $model = new static(); $schema = $model->getTableSchema(); if ($schema) { $out = []; foreach ($schema->columns as $name => $column) { /** @var ColumnSchema $column */ if ('service_id' === $name || 'api_key' === $name || 'storage_type' === $name || $column->autoIncrement) { continue; } $temp = $column->toArray(); static::prepareConfigSchemaField($temp); $out[] = $temp; } return $out; } return null; }
public static function isField($field) { $m = new static(); /** @type TableSchema $tableSchema */ $tableSchema = $m->getTableSchema(); $columns = $tableSchema->getColumnNames(); return in_array($field, $columns); }
/** * {@inheritdoc} */ public static function getConfigSchema() { $model = new static(); $schema = $model->getTableSchema(); if ($schema) { $out = []; foreach ($schema->columns as $name => $column) { // Skip if column is hidden if (in_array($name, $model->getHidden())) { continue; } /** @var ColumnSchema $column */ if ('service_id' === $name || $column->autoIncrement) { continue; } $temp = $column->toArray(); static::prepareConfigSchemaField($temp); $out[] = $temp; } return $out; } return null; }