Sometimes you need to re-use some functionality in multiple places like commands, controller functions or other specific events.
Instead of copying the code and producing duplicate code a good solution are Utility Classes.
In this talk I will go more in depth in the following topics:
Why we need PHP Namespaces
How are PHP Namespaces set up in CakePHP
How do I use PHP Namespaces