Class **Phalcon\\Mvc\\Collection\\Manager** =========================================== *implements* :doc:`Phalcon\\DI\\InjectionAwareInterface `, :doc:`Phalcon\\Events\\EventsAwareInterface ` This components controls the initialization of models, keeping record of relations between the different models of the application. A CollectionManager is injected to a model via a Dependency Injector Container such as Phalcon\\DI. .. code-block:: php set('collectionManager', function(){ return new Phalcon\Mvc\Collection\Manager(); }); $robot = new Robots($di); Methods --------- public **setDI** (:doc:`Phalcon\\DiInterface ` $dependencyInjector) Sets the DependencyInjector container public :doc:`Phalcon\\DiInterface ` **getDI** () Returns the DependencyInjector container public **setEventsManager** (:doc:`Phalcon\\Events\\ManagerInterface ` $eventsManager) Sets the event manager public :doc:`Phalcon\\Events\\ManagerInterface ` **getEventsManager** () Returns the internal event manager public **setCustomEventsManager** (:doc:`Phalcon\\Mvc\\CollectionInterface ` $model, :doc:`Phalcon\\Events\\ManagerInterface ` $eventsManager) Sets a custom events manager for a specific model public :doc:`Phalcon\\Events\\ManagerInterface ` **getCustomEventsManager** (:doc:`Phalcon\\Mvc\\CollectionInterface ` $model) Returns a custom events manager related to a model public **initialize** (:doc:`Phalcon\\Mvc\\CollectionInterface ` $model) Initializes a model in the models manager public *bool* **isInitialized** (*string* $modelName) Check whether a model is already initialized public :doc:`Phalcon\\Mvc\\CollectionInterface ` **getLastInitialized** () Get the latest initialized model public **setConnectionService** (:doc:`Phalcon\\Mvc\\CollectionInterface ` $model, *string* $connectionService) Sets a connection service for a specific model public **useImplicitObjectIds** (:doc:`Phalcon\\Mvc\\CollectionInterface ` $model, *boolean* $useImplicitObjectIds) Sets if a model must use implicit objects ids public *boolean* **isUsingImplicitObjectIds** (:doc:`Phalcon\\Mvc\\CollectionInterface ` $model) Checks if a model is using implicit object ids public :doc:`Phalcon\\Db\\AdapterInterface ` **getConnection** (:doc:`Phalcon\\Mvc\\CollectionInterface ` $model) Returns the connection related to a model public **notifyEvent** (*string* $eventName, :doc:`Phalcon\\Mvc\\CollectionInterface ` $model) Receives events generated in the models and dispatches them to a events-manager if available Notify the behaviors that are listening in the model