Skip to content

Commit

Permalink
fix milioInMemoryRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
Miliooo committed Mar 1, 2016
1 parent 8a0c529 commit 5e771ef
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions src/ReadModel/InMemory/MilioInMemoryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ public function __construct(RepositoryInterface $repository)
}

/**
* @param $id
* @return ReadModelInterface
*
* @throws NotFoundReadModelException when read model was not found
* {@inheritdoc}
*/
public function findOrFail($id)
{
Expand All @@ -34,11 +31,7 @@ public function findOrFail($id)
}

/**
* Finds a single read model by a set of criteria.
*
* @param array $fields
*
* @return ReadModelInterface|null
* {@inheritdoc}
*/
public function findOneBy(array $fields)
{
Expand All @@ -57,38 +50,44 @@ public function save(ReadModelInterface $data)
}

/**
* @param string $id
*
* @return ReadModelInterface|null
* {@inheritdoc}
*/
public function find($id)
{
return $this->repository->find($id);
}

/**
* @param array $fields
*
* @return ReadModelInterface[]
* {@inheritdoc}
*/
public function findBy(array $fields)
{
return $this->repository->findBy($fields);
}

/**
* @return ReadModelInterface[]
* {@inheritdoc}
*/
public function findAll()
{
return $this->repository->findAll();
}

/**
* @param string $id
* {@inheritdoc}
*/
public function remove($id)
{
return $this->repository->remove($id);
}

/**
* This is not supported, since the read model projectors should not use this.
*
* It's used when outputting read models in the backend. Maybe it should be part of another interface.
*/
public function findByCriteria(array $criteria, array $orderBy = null, $limit = null, $offset = null)
{
return new \InvalidArgumentException('in memory repository does not implement this');
}
}

0 comments on commit 5e771ef

Please sign in to comment.