-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from gyKa/multiple_shops
Fix multiple shop id functionality.
- Loading branch information
Showing
9 changed files
with
466 additions
and
356 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
parameters: | ||
ongr_connections.extractor.doctrine_extractor.class: ONGR\ConnectionsBundle\Sync\Extractor\DoctrineExtractor | ||
ongr_connections.extractor.passthrough_extractor.class: ONGR\ConnectionsBundle\Sync\Extractor\PassthroughExtractor | ||
ongr_connections.sync.relations_collection.class: ONGR\ConnectionsBundle\Sync\Extractor\Relation\RelationsCollection | ||
|
||
services: | ||
ongr_connections.sync.extractor.doctrine_extractor: | ||
class: ONGR\ConnectionsBundle\Sync\Extractor\DoctrineExtractor | ||
class: %ongr_connections.extractor.doctrine_extractor.class% | ||
calls: | ||
- [ setRelationsCollection, [ @ongr_connections.sync.relations_collection ] ] | ||
- [ setConnection, [ @database_connection ] ] | ||
- [ setStorageFacility, [ @ongr_connections.sync.sync_storage ] ] | ||
- [ setContainer, [ @service_container ] ] | ||
|
||
ongr_connections.sync.extractor.passthrough_extractor: | ||
class: %ongr_connections.extractor.passthrough_extractor.class% | ||
calls: | ||
- [ setStorageFacility, [ @ongr_connections.sync.sync_storage ] ] | ||
- [ setContainer, [ @service_container ] ] | ||
|
||
ongr_connections.sync.relations_collection: | ||
class: %ongr_connections.sync.relations_collection.class% |
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,50 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the ONGR package. | ||
* | ||
* (c) NFQ Technologies UAB <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace ONGR\ConnectionsBundle\Sync\Extractor; | ||
|
||
use Symfony\Component\DependencyInjection\ContainerInterface; | ||
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; | ||
|
||
/** | ||
* Common actions required for all extractors. | ||
*/ | ||
abstract class AbstractExtractor | ||
{ | ||
/** | ||
* @var ContainerInterface | ||
*/ | ||
private $container; | ||
|
||
/** | ||
* @param ContainerInterface $container | ||
*/ | ||
public function setContainer(ContainerInterface $container = null) | ||
{ | ||
$this->container = $container; | ||
} | ||
|
||
/** | ||
* Gets ids of shops from the configuration. | ||
* | ||
* @return array | ||
*/ | ||
protected function getShopIds() | ||
{ | ||
try { | ||
$shops = $this->container->getParameter('shop_ids'); | ||
} catch (InvalidArgumentException $e) { | ||
$shops = []; | ||
} | ||
|
||
return $shops; | ||
} | ||
} |
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
Oops, something went wrong.