yii\gii\generators\model\Generator::hints PHP Method

hints() public method

public hints ( )
    public function hints()
    {
        return array_merge(parent::hints(), ['ns' => 'This is the namespace of the ActiveRecord class to be generated, e.g., <code>app\\models</code>', 'db' => 'This is the ID of the DB application component.', 'tableName' => 'This is the name of the DB table that the new ActiveRecord class is associated with, e.g. <code>post</code>.
                The table name may consist of the DB schema part if needed, e.g. <code>public.post</code>.
                The table name may end with asterisk to match multiple table names, e.g. <code>tbl_*</code>
                will match tables who name starts with <code>tbl_</code>. In this case, multiple ActiveRecord classes
                will be generated, one for each matching table name; and the class names will be generated from
                the matching characters. For example, table <code>tbl_post</code> will generate <code>Post</code>
                class.', 'modelClass' => 'This is the name of the ActiveRecord class to be generated. The class name should not contain
                the namespace part as it is specified in "Namespace". You do not need to specify the class name
                if "Table Name" ends with asterisk, in which case multiple ActiveRecord classes will be generated.', 'baseClass' => 'This is the base class of the new ActiveRecord class. It should be a fully qualified namespaced class name.', 'generateRelations' => 'This indicates whether the generator should generate relations based on
                foreign key constraints it detects in the database. Note that if your database contains too many tables,
                you may want to uncheck this option to accelerate the code generation process.', 'generateRelationsFromCurrentSchema' => 'This indicates whether the generator should generate relations from current schema or from all available schemas.', 'generateLabelsFromComments' => 'This indicates whether the generator should generate attribute labels
                by using the comments of the corresponding DB columns.', 'useTablePrefix' => 'This indicates whether the table name returned by the generated ActiveRecord class
                should consider the <code>tablePrefix</code> setting of the DB connection. For example, if the
                table name is <code>tbl_post</code> and <code>tablePrefix=tbl_</code>, the ActiveRecord class
                will return the table name as <code>{{%post}}</code>.', 'useSchemaName' => 'This indicates whether to include the schema name in the ActiveRecord class
                when it\'s auto generated. Only non default schema would be used.', 'generateQuery' => 'This indicates whether to generate ActiveQuery for the ActiveRecord class.', 'queryNs' => 'This is the namespace of the ActiveQuery class to be generated, e.g., <code>app\\models</code>', 'queryClass' => 'This is the name of the ActiveQuery class to be generated. The class name should not contain
                the namespace part as it is specified in "ActiveQuery Namespace". You do not need to specify the class name
                if "Table Name" ends with asterisk, in which case multiple ActiveQuery classes will be generated.', 'queryBaseClass' => 'This is the base class of the new ActiveQuery class. It should be a fully qualified namespaced class name.']);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function hints()
 {
     return array_merge(parent::hints(), ['queryNs' => 'The namespace/directory in which the ActiveQuery class is beeing generated in.', 'includeTimestampBehavior' => 'Automatically includes a timestamp behavior to set the created_at and
             updated_at fields automatically. This option will also modify the rules accordingly.', 'createdColumnName' => 'The column name of the field that is set to the current time when a new record is
             added.', 'updatedColumnName' => 'The column name of the field that is set to the current time when a new record is
             added or an existing record is updated.']);
 }
All Usage Examples Of yii\gii\generators\model\Generator::hints