Skip to content

Commit

Permalink
Repository::add() void
Browse files Browse the repository at this point in the history
  • Loading branch information
hugues-m committed Jan 26, 2016
1 parent 8e0f6a1 commit 53d06ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/Doctrine/ODM/MongoDB/AbstractMongoRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,11 @@ public function get(Identity $identity)
/**
* @param AggregateRoot $document
*
* @return self
* @return void
*/
public function add(AggregateRoot $document)
{
$this->dm->persist($document);

return $this;
}

/**
Expand Down
6 changes: 2 additions & 4 deletions src/Doctrine/ORM/AbstractORMRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,11 @@ public function get(Identity $identity): AggregateRoot
/**
* @param AggregateRoot $document
*
* @return self
* @return void
*/
public function add(AggregateRoot $document): self
public function add(AggregateRoot $document)
{
$this->em->persist($document);

return $this;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/MessageBus/Middleware/PersistsMessages.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare (strict_types = 1);

namespace HMLB\DDDBundle\MessageBus\Middleware;

Expand Down Expand Up @@ -61,6 +62,7 @@ public function __construct(LoggerInterface $logger, ObjectManager $om, bool $pe
public function handle($message, callable $next)
{
if ($message instanceof PersistentMessage && $this->shouldPersistMessage($message)) {
$this->logger->debug('PersistsMessage persisting '.get_class($message));
try {
$message->getId();
} catch (PersistentMessageWithoutIdentityException $e) {
Expand Down

0 comments on commit 53d06ee

Please sign in to comment.