In my application I want to perform some maintenance tasks.
Therefore I run with a cronjob the overall maintenance function.
protected function execute(InputInterface $input, OutputInterface $output)
{
   Maintenance::checkDowngradeAccounts();
}
In an separate command file I run all my different functions. See here complete command file:
namespace Mtr\MyBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
class Maintenance extends ContainerAwareCommand
{
    public function checkDowngradeAccounts() {
        // get downgrade accounts
        $downgrade = $this->getDoctrine()
            ->getRepository('MyBundle:Account')
            ->findAllWithDowngrade();
    }
}
Only the Symfony $this object is not known in this file link in a normal controller. How can I include or get this container object?