This repository has been archived by the owner on Jul 17, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
263 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/ChangeSet/ChangeSetListener/IdentityMapSynchronizerInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
namespace ChangeSet\ChangeSetListener; | ||
|
||
use Zend\EventManager\EventInterface; | ||
|
||
Interface IdentityMapSynchronizerInterface | ||
{ | ||
public function addToIdentityMap(EventInterface $event); | ||
|
||
public function removeFromIdentityMap(EventInterface $event); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace ChangeSet\Container; | ||
|
||
use Pimple; | ||
|
||
class Container extends Pimple | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace ChangeSet\Container; | ||
|
||
use Pimple; | ||
|
||
class IdentityExtractorContainer extends Pimple implements IdentityExtractorContainerInterface | ||
{ | ||
|
||
public function getExtractor($className) | ||
{ | ||
return $this[$className]; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/ChangeSet/Container/IdentityExtractorContainerInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace ChangeSet\Container; | ||
|
||
Interface IdentityExtractorContainerInterface | ||
{ | ||
|
||
public function getExtractor($className); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace ChangeSet\Container; | ||
|
||
use Pimple; | ||
|
||
class RepositoryContainer extends Pimple implements RepositoryContainerInterface | ||
{ | ||
|
||
public function getObjectRepository($className) | ||
{ | ||
return $this[$className]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace ChangeSet\Container; | ||
|
||
Interface RepositoryContainerInterface | ||
{ | ||
|
||
public function getObjectRepository($className); | ||
} |
12 changes: 0 additions & 12 deletions
12
src/ChangeSet/IdentityExtractor/IdentityExtractorFactory.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
namespace ChangeSet\ObjectRepository; | ||
|
||
use ChangeSet\UnitOfWork\UnitOfWorkInterface; | ||
use ChangeSet\ObjectLoader\ObjectLoaderInterface; | ||
use ChangeSet\IdentityMap\IdentityMapInterface; | ||
use ChangeSet\ObjectRepository\ObjectRepositoryInterface; | ||
|
||
abstract class ObjectRepository implements ObjectRepositoryInterface | ||
{ | ||
protected $unitOfWork; | ||
protected $objectLoader; | ||
protected $identityMap; | ||
protected $entityClassName; | ||
|
||
public function __construct( | ||
UnitOfWorkInterface $unitOfWork, | ||
ObjectLoaderInterface $objectLoader, | ||
IdentityMapInterface $identityMap, | ||
$entityClassName | ||
) | ||
{ | ||
$this->unitOfWork = $unitOfWork; | ||
$this->objectLoader = $objectLoader; | ||
$this->identityMap = $identityMap; | ||
$this->entityClassName = $entityClassName; | ||
} | ||
|
||
abstract public function add($object); | ||
|
||
abstract public function remove($object); | ||
|
||
abstract public function get($id); | ||
|
||
abstract public function getReference($id); | ||
|
||
/** | ||
* @param mixed $entityClassName | ||
*/ | ||
public function setEntityClassName($entityClassName) | ||
{ | ||
$this->entityClassName = $entityClassName; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getEntityClassName() | ||
{ | ||
return $this->entityClassName; | ||
} | ||
} |
32 changes: 0 additions & 32 deletions
32
src/ChangeSet/ObjectRepository/ObjectRepositoryFactory.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.