plugin/agenda/Manager/AgendaManager.php
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);
    }
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);
    }
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 ) ; }
Find every EventInvitation for a given user and the replace him by another.

@param User $from
@param User $to

@return int
Find every EventInvitation for a given user and the replace him by another .