phalcon / incubator

Incubator adapters/functionality for the Phalcon PHP Framework
Other
730 stars 339 forks source link

'collectionManager' or 'collectionsManager' #971

Closed lifewcody closed 1 year ago

lifewcody commented 2 years ago

Questions should go to https://forum.phalconphp.com Documentation issues should go to https://github.com/phalcon/docs/issues

Expected and Actual Behavior

Describe what you are trying to achieve and what goes wrong.

There are two difference instances of collection(s)Manager

Provide output if related


When using 'collectionManager'

Service 'collectionsManager' wasn't found in the dependency injection container
#0 [internal function]: Phalcon\Di->get('collectionsMana...', NULL)
#1 /my.app/vendor/phalcon/incubator-mongodb/src/Mvc/Collection.php(129): Phalcon\Di->getShared('collectionsMana...')
#2 /my.app/vendor/phalcon/incubator-mongodb/src/Mvc/Collection.php(784): Phalcon\Incubator\MongoDB\Mvc\Collection->__construct()
#3 /my.app/app/controllers/IndexController.php(42): Phalcon\Incubator\MongoDB\Mvc\Collection::find(Array)
#4 [internal function]: IndexController->indexAction()
#5 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->callActionMethod(Object(IndexController), 'indexAction', Array)
#6 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->dispatch()
#7 /my.app/public/index.php(60): Phalcon\Mvc\Application->handle('/')

When using 'collectionsManager'

Service 'collectionManager' wasn't found in the dependency injection container
#0 [internal function]: Phalcon\Di->get('collectionManag...', NULL)
#1 /my.app/vendor/phalcon/incubator-mongodb/src/Mvc/Collection.php(1292): Phalcon\Di->getShared('collectionManag...')
#2 [internal function]: Phalcon\Incubator\MongoDB\Mvc\Collection->unserialize('a:10:{s:3:"_id"...')
#3 [internal function]: session_start()
#4 /my.app/app/config/services.php(146): Phalcon\Session\Manager->start()
#5 [internal function]: Closure->{closure}()
#6 [internal function]: Phalcon\Di\Service->resolve(NULL, Object(Phalcon\Di\FactoryDefault))
#7 [internal function]: Phalcon\Di->get('session', NULL)
#8 [internal function]: Phalcon\Di->getShared('session')
#9 /my.app/app/controllers/ControllerBase.php(76): Phalcon\Di\Injectable->__get('session')
#10 [internal function]: ControllerBase->beforeExecuteRoute(Object(Phalcon\Mvc\Dispatcher))
#11 [internal function]: Phalcon\Dispatcher\AbstractDispatcher->dispatch()
#12 /my.app/public/index.php(60): Phalcon\Mvc\Application->handle('/')

Provide minimal script to reproduce the issue

// paste code

Details

Jeckerson commented 1 year ago

Fixed in phalcon/incubator-mongodb@v2.0.0.

Now it is always in plural: collectionsManager