mongodb\i18n\MongoDbMessageSource loadMessages()

loadMessages() protected method Loads the message translation for the specified language and category. If translation for specific locale code such as en-US isn't found it tries more generic en. protected array loadMessages ( $category, $language )$category string The message category $language string The target language return array The loaded messages. The keys are original messages, and the values are translated messages.

mongodb\i18n\MongoDbMessageSource $collection

$collection public property The name of the MongoDB collection, which stores translated messages. This collection is better to be pre-created with fields 'category' and 'language' indexed. public string|array $collection = 'message'

mongodb\i18n\MongoDbMessageSource $cache

$cache public property The cache object or the application component ID of the cache object. The messages data will be cached using this cache object. Note, that to enable caching you have to set $enableCaching to true, otherwise setting this property has no effect. After the MongoDbMessageSource object is created, if you want to change this property, you should only assign it with a cache object. This can also be a configuration array for creating the object. See also: $cachingDuration $en

mongodb\i18n\MongoDbMessageSource $db

$db public property The MongoDB connection object or the application component ID of the MongoDB connection. After the MongoDbMessageSource object is created, if you want to change this property, you should only assign it with a MongoDB connection object. This can also be a configuration array for creating the object. public yii\mongodb\Connection|array|string $db = 'mongodb'

mongodb\i18n\MongoDbMessageSource $cachingDuration

$cachingDuration public property The time in seconds that the messages can remain valid in cache. Use 0 to indicate that the cached data will never expire. See also $enableCaching. public integer $cachingDuration = 0

mongodb\gii\model\Generator validateDb()

validateDb() public method Validates the $db attribute. public void validateDb ( )

mongodb\gii\model\Generator validateModelClass()

validateModelClass() public method Validates the $modelClass attribute. public void validateModelClass ( )

mongodb\gii\model\Generator validateNamespace()

validateNamespace() public method Validates the $ns attribute. public void validateNamespace ( )

mongodb\gii\model\Generator rules()

rules() public method Returns the validation rules for attributes. Validation rules are used by validate() to check if attribute values are valid. Child classes may override this method to declare different validation rules. Each rule is an array with the following structure: [ ['attribute1', 'attribute2'], 'validator type', 'on' => ['scenario1', 'scenario2'], //...other parameters... ] where attribute list: required, specifies the attributes array to be validated, for s

mongodb\gii\model\Generator requiredTemplates()

requiredTemplates() public method Returns a list of code template files that are required. Derived classes usually should override this method if they require the existence of certain template files. public array requiredTemplates ( )return array List of code template files that are required. They should be file paths relative to $templatePath.