Class **Phalcon\\CLI\\Task** ============================ *extends* :doc:`Phalcon\\DI\\Injectable ` *implements* :doc:`Phalcon\\Events\\EventsAwareInterface `, :doc:`Phalcon\\DI\\InjectionAwareInterface ` Every command-line task should extend this class that encapsulates all the task functionality A task can be used to run "tasks" such as migrations, cronjobs, unit-tests, or anything that you want. The Task class should at least have a "mainAction" method .. code-block:: php ` $dependencyInjector) inherited from Phalcon\\DI\\Injectable Sets the dependency injector public :doc:`Phalcon\\DiInterface ` **getDI** () inherited from Phalcon\\DI\\Injectable Returns the internal dependency injector public **setEventsManager** (:doc:`Phalcon\\Events\\ManagerInterface ` $eventsManager) inherited from Phalcon\\DI\\Injectable Sets the event manager public :doc:`Phalcon\\Events\\ManagerInterface ` **getEventsManager** () inherited from Phalcon\\DI\\Injectable Returns the internal event manager public **__get** (*string* $propertyName) inherited from Phalcon\\DI\\Injectable Magic method __get