mongodb\ActiveRecord collectionName()

collectionName() public static method

Declares the name of the Mongo collection associated with this AR class.

Collection name can be either a string or array:

  • if string considered as the name of the collection inside the default database.
  • if array - first element considered as the name of the database, second - as name of collection inside that database

By default this method returns the class name as the collection name by calling yii\helpers\Inflector::camel2id(). For example, 'Customer' becomes 'customer', and 'OrderItem' becomes 'order_item'. You may override this method if the collection is not named after this convention.

public static string|array collectionName ( )
return string|array

The collection name

doc_Yii
2016-10-30 17:07:24
Comments
Leave a Comment

Please login to continue.