示例#1
0
 protected function setUsersIdsByEmailAddressId(Entity $entity, $emailAddressId, $addAssignedUser = false)
 {
     $user = $this->getEntityManager()->getRepository('EmailAddress')->getEntityByAddressId($emailAddressId, 'User');
     if ($user) {
         $entity->addLinkMultipleId('users', $user->id);
         if ($addAssignedUser) {
             $entity->addLinkMultipleId('assignedUsers', $user->id);
         }
     }
 }