-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AddressBundle] add AddressIdentifierRepository
- Loading branch information
1 parent
1c342bf
commit daac0ac
Showing
4 changed files
with
62 additions
and
2 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
33 changes: 33 additions & 0 deletions
33
src/CoreShop/Bundle/AddressBundle/Doctrine/ORM/AddressIdentifierRepository.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,33 @@ | ||
<?php | ||
/** | ||
* CoreShop. | ||
* | ||
* This source file is subject to the GNU General Public License version 3 (GPLv3) | ||
* For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt | ||
* files that are distributed with this source code. | ||
* | ||
* @copyright Copyright (c) 2015-2019 Dominik Pfaffenbauer (https://www.pfaffenbauer.at) | ||
* @license https://www.coreshop.org/license GNU General Public License version 3 (GPLv3) | ||
*/ | ||
|
||
namespace CoreShop\Bundle\AddressBundle\Doctrine\ORM; | ||
|
||
use CoreShop\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; | ||
use CoreShop\Component\Address\Repository\AddressIdentifierRepositoryInterface; | ||
|
||
class AddressIdentifierRepository extends EntityRepository implements AddressIdentifierRepositoryInterface | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function findByName($name) | ||
{ | ||
return $this->createQueryBuilder('o') | ||
->andWhere('o.name = :name') | ||
->setParameter('name', $name) | ||
->getQuery() | ||
->useQueryCache(true) | ||
->useResultCache(true) | ||
->getResult(); | ||
} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
src/CoreShop/Component/Address/Repository/AddressIdentifierRepositoryInterface.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,26 @@ | ||
<?php | ||
/** | ||
* CoreShop. | ||
* | ||
* This source file is subject to the GNU General Public License version 3 (GPLv3) | ||
* For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt | ||
* files that are distributed with this source code. | ||
* | ||
* @copyright Copyright (c) 2015-2019 Dominik Pfaffenbauer (https://www.pfaffenbauer.at) | ||
* @license https://www.coreshop.org/license GNU General Public License version 3 (GPLv3) | ||
*/ | ||
|
||
namespace CoreShop\Component\Address\Repository; | ||
|
||
use CoreShop\Component\Address\Model\AddressIdentifierInterface; | ||
use CoreShop\Component\Resource\Repository\RepositoryInterface; | ||
|
||
interface AddressIdentifierRepositoryInterface extends RepositoryInterface | ||
{ | ||
/** | ||
* @param string $name | ||
* | ||
* @return AddressIdentifierInterface | ||
*/ | ||
public function findByName($name); | ||
} |