Ejemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return array_merge(parent::rules(), [[['db', 'nsModel', 'tableName', 'modelClass', 'queryNs'], 'filter', 'filter' => 'trim'], [['tableName', 'db'], 'required'], [['tableName'], 'match', 'pattern' => '/^(\\w+\\.)?([\\w\\*]+)$/', 'message' => 'Only word characters, and optionally an asterisk and/or a dot are allowed.'], [['tableName'], 'validateTableName'], [['nsModel', 'baseModelClass', 'queryNs', 'queryBaseClass'], 'match', 'pattern' => '/^[\\w\\\\]+$/', 'message' => 'Only word characters and backslashes are allowed.'], [['modelClass', 'baseModelClass', 'db'], 'match', 'pattern' => '/^[\\w\\\\]*$/', 'message' => 'Only word characters and backslashes are allowed.'], [['queryBaseClass', 'queryClass'], 'validateClass', 'params' => ['extends' => ActiveQuery::className()]], [['db'], 'validateDb'], [['enableI18N', 'generateQuery', 'generateLabelsFromComments', 'useTablePrefix', 'generateMigrations', 'generateAttributeHints', 'generateBaseOnly'], 'boolean'], [['generateRelations'], 'in', 'range' => [self::RELATIONS_NONE, self::RELATIONS_ALL, self::RELATIONS_ALL_INVERSE]], [['messageCategory'], 'validateMessageCategory', 'skipOnEmpty' => false], [['skippedColumns', 'skippedRelations', 'blameableValue', 'nameAttribute', 'hiddenColumns', 'timestampValue', 'optimisticLock', 'createdAt', 'updatedAt', 'createdBy', 'updatedBy', 'blameableValue', 'UUIDColumn', 'deletedBy', 'deletedAt'], 'safe']]);
 }
Ejemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     return array_merge(parent::rules(), [[['db', 'nsModel', 'viewPath', 'queryNs', 'nsController', 'nsSearchModel', 'tableName', 'modelClass', 'searchModelClass', 'baseControllerClass'], 'filter', 'filter' => 'trim'], [['tableName', 'baseControllerClass', 'indexWidgetType', 'db'], 'required'], [['tableName'], 'match', 'pattern' => '/^(\\w+\\.)?([\\w\\*]+)$/', 'message' => 'Only word characters, and optionally an asterisk and/or a dot are allowed.'], [['tableName'], 'validateTableName'], [['modelClass', 'baseControllerClass', 'searchModelClass', 'db', 'queryClass'], 'match', 'pattern' => '/^[\\w\\\\]*$/', 'message' => 'Only word characters and backslashes are allowed.'], [['baseControllerClass'], 'validateClass', 'params' => ['extends' => Controller::className()]], [['db'], 'validateDb'], [['controllerClass'], 'match', 'pattern' => '/Controller$/', 'message' => 'Controller class name must be suffixed with "Controller".'], [['controllerClass'], 'match', 'pattern' => '/(^|\\\\)[A-Z][^\\\\]+Controller$/', 'message' => 'Controller class name must start with an uppercase letter.'], [['indexWidgetType'], 'in', 'range' => ['grid', 'list']], [['enableI18N', 'generateRelations', 'generateSearchModel', 'pluralize', 'expandable', 'cancelable', 'pdf', 'loggedUserOnly'], 'boolean'], [['messageCategory'], 'validateMessageCategory', 'skipOnEmpty' => false], [['viewPath', 'skippedRelations', 'skippedColumns', 'controllerClass', 'blameableValue', 'nameAttribute', 'hiddenColumns', 'createdAt', 'updatedAt', 'createdBy', 'updatedBy', 'UUIDColumn', 'saveAsNew'], 'safe']]);
 }