public function replaceEventInvitationUser(User $from, User $to)
    {
        $eventInvitations = $this->om->getRepository('ClarolineAgendaBundle:EventInvitation')->findByUser($from);

        if (count($eventInvitations) > 0) {
            foreach ($eventInvitations as $eventInvitation) {
                $eventInvitation->setUser($to);
            }

            $this->om->flush();
        }

        return count($eventInvitations);
    }