public static function init() { if (!self::$collection) { self::$client = new \MongoClient(); self::$db = self::$client->{self::dbName}; self::$collection = self::$db->{self::collectionName}; } }