Skip to content

Commit

Permalink
correção de getByCriteria
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhonatan Teixeira committed Mar 22, 2018
1 parent 7cb0fba commit 4645015
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/Webservice/TransferRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Persistence\ObjectRepository;
use Vox\Webservice\Exception\WebserviceResponseException;
use Vox\Webservice\Proxy\ProxyFactoryInterface;

Expand Down Expand Up @@ -40,9 +39,9 @@ final class TransferRepository implements TransferRepositoryInterface

/**
* @param string $transferName
* @param \Vox\Webservice\WebserviceClientInterface $webserviceClient
* @param \Vox\Webservice\ObjectStorageInterface $objectStorage
* @param \Vox\Webservice\TransferManagerInterface $transferManager
* @param WebserviceClientInterface $webserviceClient
* @param ObjectStorageInterface $objectStorage
* @param TransferManagerInterface $transferManager
* @param ProxyFactoryInterface $proxyFactory
*/
public function __construct(
Expand Down Expand Up @@ -153,6 +152,10 @@ public function findOneByCriteria(CriteriaInterface $criteria)
if ($transfer && !$this->objectStorage->contains($transfer)) {
$this->objectStorage->attach($transfer);
}

if ($transfer) {
$transfer = $this->proxyFactory->createProxy($transfer, $this->transferManager);
}

return $transfer;
}
Expand Down

0 comments on commit 4645015

Please sign in to comment.