Class yii\mongodb\gii\model\Generator

Inheritanceyii\mongodb\gii\model\Generator » yii\gii\Generator
Available since version2.0

This generator will generate ActiveRecord class for the specified MongoDB collection.

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
generateClassName() Generates a class name from the specified collection name. yii\mongodb\gii\model\Generator
getDbConnection() yii\mongodb\gii\model\Generator

Property Details

$attributeList public property
public $attributeList null
$baseClass public property
public $baseClass 'yii\mongodb\ActiveRecord'
$collectionName public property
public $collectionName null
$databaseName public property
public $databaseName null
$db public property
public $db 'mongodb'
$modelClass public property
public $modelClass null
$ns public property
public $ns 'app\models'

Method Details

attributeLabels() public method

public void attributeLabels ( )
autoCompleteData() public method

public void autoCompleteData ( )
generate() public method

public void generate ( )
generateClassName() protected method

Generates a class name from the specified collection name.

protected string generateClassName ( $collectionName )
$collectionName string

The collection name (which may contain schema prefix)

return string

The generated class name

generateLabels() public method

Generates the attribute labels for the specified attributes list.

public array generateLabels ( $attributes )
$attributes array

The list of attributes

return array

The generated attribute labels (name => label)

generateRules() public method

Generates validation rules for the specified collection.

public array generateRules ( $attributes )
$attributes array

The list of attributes

return array

The generated validation rules

getDbConnection() protected method

protected yii\mongodb\Connection getDbConnection ( )
return yii\mongodb\Connection

The DB connection as specified by $db.

getDescription() public method

public void getDescription ( )
getName() public method

public void getName ( )
hints() public method

public void hints ( )
requiredTemplates() public method

public void requiredTemplates ( )
rules() public method

public void rules ( )
stickyAttributes() public method

public void stickyAttributes ( )
validateCollectionName() public method

Validates the $collectionName attribute.

public void validateCollectionName ( )
validateDb() public method

Validates the $db attribute.

public void validateDb ( )
validateModelClass() public method

Validates the $modelClass attribute.

public void validateModelClass ( )
validateNamespace() public method

Validates the $ns attribute.

public void validateNamespace ( )