/**
  * Denormalize MovieWasRescheduled event.
  *
  * @param MovieWasRescheduled              $event
  * @param MovieThatWereScheduledRepository $repository
  *
  * @return MovieThatWereScheduled
  */
 public function handle(MovieWasRescheduled $event, MovieThatWereScheduledRepository $repository)
 {
     /** @var MovieThatWereScheduled $model */
     $model = $repository->findById((string) $event->id);
     $model->reschedule($event->schedule->format('Y-m-d H:i:s'));
     $repository->save($model);
     return $model;
 }
 /**
  * Denormalize MovieWasScheduled event.
  *
  * @param MovieWasScheduled                $event
  * @param MovieThatWereScheduledRepository $repository
  *
  * @return MovieThatWereScheduled
  */
 public function handle(MovieWasScheduled $event, MovieThatWereScheduledRepository $repository)
 {
     $model = new MovieThatWereScheduled($event->id->toString(), $event->name, $event->schedule->format('Y-m-d H:i:s'), $event->price);
     $repository->save($model);
     return $model;
 }
 /**
  * query all scheduled movie.
  *
  * @param AllScheduledMovieQuery         $query
  * @param MovieThatWereScheduledRepository $repository
  *
  * @return Collection
  */
 public function handle(AllScheduledMovieQuery $query, MovieThatWereScheduledRepository $repository)
 {
     return $repository->findAll();
 }