public function createNew(string $endpoint, string $title, string $description, string $url, string $image) { $notification = new Notification(); $notification->setEndpoint($endpoint); $notification->setTitle($title); $notification->setDescription($description); $notification->setUrl($url); $notification->setImage($image); $this->entityManager->persist($notification); $this->entityManager->flush(); return $notification; }
public function getDomainModel(\TubeService\Data\Database\Entity\Notification $item) : Notification { $id = new ID($item->getID()); $image = new Notification($id, $item->getCreatedAt(), $item->getUpdatedAt(), $item->getEndpoint(), $item->getTitle(), $item->getDescription(), $item->getUrl(), $item->getImage()); return $image; }