mongodb\log\MongoDbTarget init()

init() public method Initializes the MongoDbTarget component. This method will initialize the $db property to make sure it refers to a valid MongoDB connection. public void init ( )throws yii\base\InvalidConfigException if $db is invalid.

mongodb\log\MongoDbTarget export()

export() public method Stores log messages to MongoDB collection. public void export ( )

mongodb\log\MongoDbTarget $logCollection

$logCollection public property The name of the MongoDB collection that stores the session data. Please refer to yii\mongodb\Connection::getCollection() on how to specify this parameter. This collection is better to be pre-created with fields 'id' and 'expire' indexed. public string|array $logCollection = 'log'

mongodb\log\MongoDbTarget $db

$db public property The MongoDB connection object or the application component ID of the MongoDB connection. After the MongoDbTarget object is created, if you want to change this property, you should only assign it with a MongoDB connection object. public yii\mongodb\Connection|string $db = 'mongodb'

mongodb\LogBuilder processData()

processData() protected method Pre-processes the log data before sending it to json_encode(). protected mixed processData ( $data )$data mixed Raw data. return mixed The processed data.

mongodb\LogBuilder generateToken()

generateToken() public method Generate log/profile token. public string generateToken ( $namespace, $data = [] )$namespace string|array Command namespace $data array Command data. return string Token.

mongodb\LogBuilder encodeData()

encodeData() public method Encodes complex log data into JSON format string. public string encodeData ( $data )$data mixed Raw data. return string Encoded data string.

mongodb\i18n\MongoDbMessageSource loadMessagesFromDb()

loadMessagesFromDb() protected method Loads the messages from MongoDB. You may override this method to customize the message storage in the MongoDB. protected array loadMessagesFromDb ( $category, $language )$category string The message category. $language string The target language. return array The messages loaded from database.

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 init()

init() public method Initializes the DbMessageSource component. This method will initialize the $db property to make sure it refers to a valid DB connection. Configured $cache component would also be initialized. public void init ( )throws yii\base\InvalidConfigException if $db is invalid or $cache is invalid.