public function persist(PrivateMessage $msg) { if (!$msg->getSender()->isEqual($this->getAuthor())) { throw new AccessDeniedException("You cannot save this message because you're not the sender"); } $this->repository->persist($msg); }
public function testVertices() { $this->assertEquals($this->sender, $this->sut->getSender()); $this->assertEquals($this->target, $this->sut->getTarget()); }