Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Miliooo committed Mar 27, 2016
1 parent 5e771ef commit 9932ec7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
11 changes: 9 additions & 2 deletions src/ReadModel/DoctrineORM/DoctrineORMRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Broadway\ReadModel\ReadModelInterface;
use Doctrine\ORM\EntityManagerInterface;
use Milio\CQRS\Readmodel\Exceptions\NotFoundReadModelException;
use Milio\CQRS\ReadModel\ErrorHandling\NotFoundReadModelException;
use Milio\CQRS\ReadModel\ReadModelRepositoryInterface;

/**
Expand Down Expand Up @@ -55,9 +55,16 @@ public function findBy(array $fields)
return $this->repository->findBy($fields);
}

/**
* @param array $criteria
* @param array|null $orderBy
* @param int $limit
* @param int $offset
* @return array
*/
public function findByCriteria(array $criteria, array $orderBy = null, $limit = null, $offset = null)
{
return $this->repository->findby($criteria, $orderBy, $limit, $offset);
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}

public function findOneBy(array $fields)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Milio\CQRS\ReadModel\Exceptions;
namespace Milio\CQRS\ReadModel\ErrorHandling;

/**
* Exception that gets thrown when read model could not be found by it's identifier
Expand Down
2 changes: 1 addition & 1 deletion src/ReadModel/InMemory/MilioInMemoryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Broadway\ReadModel\ReadModelInterface;
use Broadway\ReadModel\RepositoryInterface;
use Milio\CQRS\ReadModel\Exceptions\NotFoundReadModelException;
use Milio\CQRS\ReadModel\ErrorHandling\NotFoundReadModelException;
use Milio\CQRS\ReadModel\ReadModelRepositoryInterface;

class MilioInMemoryRepository implements ReadModelRepositoryInterface
Expand Down
4 changes: 2 additions & 2 deletions src/ReadModel/ReadModelRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Broadway\ReadModel\ReadModelInterface;
use Broadway\ReadModel\RepositoryInterface;
use Milio\CQRS\Readmodel\Exceptions\NotFoundReadModelException;
use Milio\CQRS\ReadModel\ErrorHandling\NotFoundReadModelException;

interface ReadModelRepositoryInterface extends RepositoryInterface
{
Expand All @@ -25,5 +25,5 @@ public function findOrFail($id);
*/
public function findOneBy(array $fields);


public function findByCriteria(array $criteria, array $orderBy = null, $limit = null, $offset = null);
}
2 changes: 1 addition & 1 deletion tests/ReadModel/InMemory/MilioInMemoryRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function setup()

/**
* @test
* @expectedException \Milio\CQRS\ReadModel\Exceptions\NotFoundReadModelException
* @expectedException \Milio\CQRS\ReadModel\ErrorHandling\NotFoundReadModelException
*/
public function find_or_fail_throws_exception_when_no_result()
{
Expand Down

0 comments on commit 9932ec7

Please sign in to comment.