/**
  * @param Projection $projection
  */
 public function remove(Projection $projection)
 {
     $storedProjection = $this->repository->find($projection->getProjectionName() . '_' . $projection->getAggregateId());
     if (!empty($storedProjection)) {
         $this->manager->remove($storedProjection);
     }
 }
Exemple #2
0
 /**
  * @param Projection $projection
  * @return FromProjection
  */
 public static function createFromProjection(Projection $projection)
 {
     /** @var $projection Projection\PostListProjection */
     return new self((string) $projection->getAggregateId(), $projection->getTitle(), $projection->getPublishingDate()->format('Y-m-d H:i:s'));
 }