Joined November 2012
·

Ramon Kleiss

Cubilon
·
Nijmegen, The Netherlands
·
·
·

Posted to Code For All PHP Developers over 1 year ago

You forgot something!

foreach ($problems as $problem) {
    $problemSolved = $this->solve($problem);
    if (!$problemSolved) {
        $this->execute(self::SHOOT);
    }
    $problems[] = new Problem();
}
Posted to Symfony2 Call Service from Command over 1 year ago

You can also use extend the ContainerAwareCommand:

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;

class FooCommand extends ContainerAwareCommand
{
    // ...
}

Then you can use:

$this->get('service);
Achievements
98 Karma
610 Total ProTip Views
Interests & Skills