Skip to content

Commit

Permalink
Merge pull request #181 from GrandLTU/router-fix
Browse files Browse the repository at this point in the history
Fix router bundle version requirement.
  • Loading branch information
GrandLTU committed May 28, 2015
2 parents 9572eed + 4136c00 commit d9f3b31
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Service/PairStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@

namespace ONGR\ConnectionsBundle\Service;

use ONGR\ElasticsearchBundle\ORM\Repository;
use ONGR\ElasticsearchBundle\ORM\Manager;
use ONGR\ConnectionsBundle\Document\Pair;
use Elasticsearch\Common\Exceptions\Missing404Exception;
use ONGR\ElasticsearchBundle\Document\DocumentInterface;
use ONGR\ElasticsearchBundle\ORM\Manager;
use ONGR\ElasticsearchBundle\ORM\Repository;

/**
* Responsible for managing pairs actions.
Expand Down Expand Up @@ -65,7 +64,8 @@ public function get($key)
*/
public function set($key, $value)
{
if (($pair = $this->repository->find($key)) === null) {
$pair = $this->repository->find($key);
if ($pair === null) {
$pair = new Pair();
$pair->setId($key);
}
Expand All @@ -83,7 +83,8 @@ public function set($key, $value)
*/
public function remove($key)
{
if (($pair = $this->repository->find($key)) !== null) {
$pair = $this->repository->find($key);
if ($pair !== null) {
$this->repository->remove($pair->getId());
$this->manager->flush();
$this->manager->refresh();
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"symfony/symfony": "~2.6",
"symfony/monolog-bundle": "~2.0",
"ongr/elasticsearch-bundle": ">=0.9,<2",
"ongr/router-bundle": "~0.3.1",
"ongr/router-bundle": "~0.4",
"doctrine/orm": "~2.5"
},
"require-dev": {
Expand Down

0 comments on commit d9f3b31

Please sign in to comment.