Ejemplo n.º 1
0
 public function hasDeleteAccess(User $user, ClientActivitySummary $activitySummary)
 {
     if ($user->hasRole('ROLE_RIA') && $activitySummary->getClient()->getRia()->getId() == $user->getId()) {
         return true;
     }
     return false;
 }
 private function setClientDocument(User $client, Document $document, $isClientNotified)
 {
     if (!$client->getUserDocuments()->contains($document)) {
         $client->addUserDocument($document);
         if ($isClientNotified) {
             $this->mailer->sendClientRiaUploadedDocument($client);
         }
         $clientActivitySummary = new ClientActivitySummary();
         $clientActivitySummary->setClient($client);
         $clientActivitySummary->setDescription('Document Uploaded');
         $clientActivitySummary->setDocument($document);
         $client->addClientActivitySummary($clientActivitySummary);
         $this->em->persist($client);
     }
 }