Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
CHANGELOG
=========

0.3.0
-----

* The `StatementRepository` class is final.

* The version of the virtual `php-xapi/repository-implementation` package
provided by this package has been raised to `0.3`.

* The versions of the `php-xapi/repository-api` and `php-xapi/repository-doctrine`
requirements have been raised to `^0.3`.

0.2.0
-----

Expand Down
11 changes: 11 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
UPGRADE
=======

Upgrading from 0.2 to 0.3
-------------------------

* The `StatementRepository` class is final.

* The version of the virtual `php-xapi/repository-implementation` package
provided by this package has been raised to `0.3`.

* The versions of the `php-xapi/repository-api` and `php-xapi/repository-doctrine`
requirements have been raised to `^0.3`.

Upgrading from 0.1 to 0.2
-------------------------

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
],
"require": {
"doctrine/mongodb-odm": "~1.0",
"php-xapi/model": "^0.1.0",
"php-xapi/repository-api": "^0.2.0",
"php-xapi/repository-doctrine": "^0.2.1"
"php-xapi/model": "^1.0",
"php-xapi/repository-api": "^0.3@dev",
"php-xapi/repository-doctrine": "^0.3@dev"
},
"require-dev": {
"php-xapi/exception": "^0.1.0"
Expand All @@ -23,7 +23,7 @@
"xabbuh/xapi-mongodb-storage": "*"
},
"provide": {
"php-xapi/repository-implementation": "0.2"
"php-xapi/repository-implementation": "0.3"
},
"autoload": {
"psr-4": {
Expand All @@ -37,7 +37,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "0.2.x-dev"
"dev-master": "0.3.x-dev"
}
}
}
2 changes: 1 addition & 1 deletion metadata/MappedStatement.mongodb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd"
>
<document name="XApi\Repository\Api\Mapping\MappedStatement"
repository-class="XApi\Repository\MongoDB\Repository\MappedStatementRepository"
repository-class="XApi\Repository\MongoDB\Repository\StatementRepository"
>
<field fieldName="id" id="true" type="string" strategy="NONE" />
<reference-one field="verb" target-document="XApi\Repository\Api\Mapping\MappedVerb">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,36 @@
namespace XApi\Repository\MongoDB\Repository;

use Doctrine\ODM\MongoDB\DocumentRepository;
use XApi\Repository\Api\Mapping\MappedStatement;
use XApi\Repository\Doctrine\Repository\MappedStatementRepository as MappedStatementRepositoryInteface;
use XApi\Repository\Doctrine\Mapping\Statement;
use XApi\Repository\Doctrine\Repository\Mapping\StatementRepository as StatementRepositoryInterface;

/**
* A MongoDB backed statement repository.
*
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
*/
class MappedStatementRepository extends DocumentRepository implements MappedStatementRepositoryInteface
final class StatementRepository extends DocumentRepository implements StatementRepositoryInterface
{
/**
* {@inheritdoc}
*/
public function findMappedStatement(array $criteria)
public function findStatement(array $criteria)
{
return parent::findOneBy($criteria);
return $this->findOneBy($criteria);
}

/**
* {@inheritdoc}
*/
public function findMappedStatements(array $criteria)
public function findStatements(array $criteria)
{
return parent::findBy($criteria);
return $this->findBy($criteria);
}

/**
* {@inheritdoc}
*/
public function storeMappedStatement(MappedStatement $mappedStatement, $flush = true)
public function storeStatement(Statement $mappedStatement, $flush = true)
{
$this->getDocumentManager()->persist($mappedStatement);

Expand Down
4 changes: 2 additions & 2 deletions tests/Functional/StatementRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function createObjectManager()
$config->setHydratorDir(__DIR__.'/../hydrators');
$config->setHydratorNamespace('Hydrator');
$fileLocator = new SymfonyFileLocator(
array(__DIR__.'/../../metadata' => 'XApi\Repository\Api\Mapping'),
array(__DIR__.'/../../metadata' => 'XApi\Repository\Doctrine\Mapping'),
'.mongodb.xml'
);
$driver = new XmlDriver($fileLocator);
Expand All @@ -46,6 +46,6 @@ protected function createObjectManager()

protected function getStatementClassName()
{
return 'XApi\Repository\Api\Mapping\MappedStatement';
return 'XApi\Repository\Doctrine\Mapping\Statement';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

namespace XApi\Repository\MongoDB\Tests\Unit\Repository;

use XApi\Repository\Doctrine\Test\Unit\Repository\MappedStatementRepositoryTest as BaseStatementRepositoryTest;
use XApi\Repository\MongoDB\Repository\MappedStatementRepository;
use XApi\Repository\Doctrine\Test\Unit\Repository\Mapping\StatementRepositoryTest as BaseStatementRepositoryTest;
use XApi\Repository\MongoDB\Repository\StatementRepository;

/**
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
*/
class MappedStatementRepositoryTest extends BaseStatementRepositoryTest
class StatementRepositoryTest extends BaseStatementRepositoryTest
{
protected function getObjectManagerClass()
{
Expand All @@ -36,6 +36,6 @@ protected function getClassMetadataClass()

protected function createMappedStatementRepository($objectManager, $unitOfWork, $classMetadata)
{
return new MappedStatementRepository($objectManager, $unitOfWork, $classMetadata);
return new StatementRepository($objectManager, $unitOfWork, $classMetadata);
}
}