PreUpdate event listener crashes the site-Collection of common programming errors

I’m trying to build a preUpdate, I was doing it with a postUpdate but I didn’t contemplate the fact that I was changing whenever an edit of that entity was being made, no matter the field… so I read I should use preUpdate instead…

This is my preUpdate Listener:

namespace Prizes\PrizesBundle\EventListener;

use Doctrine\ORM\Event\LifecycleEventArgs;
use Prizes\PrizesBundle\Entity\Prize;
use Prizes\CatalogBundle\Entity\CatalogHasPrize as CHP;

/**
 * Description of DeactivatePrizesInCatalog
 *
 * @author Victoria Noguera
 * Desactiva premios en catalogos cuando se desactiven en el prize central.
 */
/**
 * @ORM\Entity
 * @ORM\HasLifecycleCallbacks
 */
class DeactivatePrizesInCatalog {
/**
     * @ORM\PrePersist()
     * @ORM\PreUpdate()
     */
    public function preUpdate(LifecycleEventArgs $args) {
       $entity = $args->getEntity();
        $entityManager = $args->getEntity

Manager();
    if ($entity instanceof Prize) {
        if ($args->hasChangedField('status')) {
            $status_new = $args->getNewValue('status');
            if ($status_new->getName() == "Inactive") {
                $statusinactive = $entityManager->getRepository('AppStatusBundle:Status')->find(8);
                $q = $entityManager->createQuery("UPDATE CatalogBundle:CatalogHasPrize c SET c.status = :statusid WHERE c.status = 7 AND c.prize = :prizeid")
                        ->setParameters(array('statusid' => $statusinactive, 'prizeid' => $entity->getId()));
                $rs = $q->getResult();
            } else if ($status_new->getName() == "Active") {
                $statusinactive = $entityManager->getRepository('AppStatusBundle:Status')->find(7);
                $q = $entityManager->createQuery("UPDATE CatalogBundle:CatalogHasPrize c SET c.status = :statusid WHERE c.status = 8 AND c.prize = :prizeid")
                        ->setParameters(array('statusid' => $statusinactive, 'prizeid' => $entity->getId()));
                $rs = $q->getResult();
            }
        }
    }
}

}

and this is the way i’m doing it on the config.yml file (I just read it goes in a services.yml, but i’ll change it later)

services:
    preupdate.listener:
        class: Prizes\PrizesBundle\EventListener\DeactivatePrizesInCatalog
        tags: 
             - { name: doctrine.event_listener , event: preUpdate }

however, when I do this, my project goes from fully functional to 503 service unavailable. Even if I just write public function preUpdate(LifecycleEventArgs $args) { } it crashes, I’m assuming a configuration issue, but I have no idea what I’m doing wrong.

I’d appreciate any help offered. Thank you