private function changeState(Cron $cron, $state, $lastError = null)
    {
        $cron->setState($state);
        $cron->setLastError($lastError);

        $em = $this->getEntityManager();
        $em->persist($cron);
        $em->flush($cron);
    }
private function changeState(Cron $cron, $state, $lastError = null)
    {
        $cron->setState($state);
        $cron->setLastError($lastError);

        $em = $this->getEntityManager();
        $em->persist($cron);
        $em->flush($cron);
    }
private function changeState ( Cron $ cron , $ state , $ lastError = null ) { $ cron -> setState ( $ state ) ; $ cron -> setLastError ( $ lastError ) ; $ em = $ this -> getEntityManager ( ) ; $ em -> persist ( $ cron ) ; $ em -> flush ( $ cron ) ; }
Change the state of the cron.

@param Cron   $cron
@param string $state
Change the state of the cron .