Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0226bbc

Browse filesBrowse files
committed
Rename 'Entity' to 'Repository' in namespaces for repository classes
1 parent 68a6ff4 commit 0226bbc
Copy full SHA for 0226bbc

File tree

Expand file treeCollapse file tree

4 files changed

+24
-24
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+24
-24
lines changed

‎doctrine/repository.rst

Copy file name to clipboardExpand all lines: doctrine/repository.rst
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To do this, add the repository class name to your entity's mapping definition:
2121
use Doctrine\ORM\Mapping as ORM;
2222
2323
/**
24-
* @ORM\Entity(repositoryClass="AppBundle\Entity\ProductRepository")
24+
* @ORM\Entity(repositoryClass="AppBundle\Repository\ProductRepository")
2525
*/
2626
class Product
2727
{
@@ -33,7 +33,7 @@ To do this, add the repository class name to your entity's mapping definition:
3333
# src/AppBundle/Resources/config/doctrine/Product.orm.yml
3434
AppBundle\Entity\Product:
3535
type: entity
36-
repositoryClass: AppBundle\Entity\ProductRepository
36+
repositoryClass: AppBundle\Repository\ProductRepository
3737
# ...
3838
3939
.. code-block:: xml
@@ -47,7 +47,7 @@ To do this, add the repository class name to your entity's mapping definition:
4747
4848
<entity
4949
name="AppBundle\Entity\Product"
50-
repository-class="AppBundle\Entity\ProductRepository">
50+
repository-class="AppBundle\Repository\ProductRepository">
5151
5252
<!-- ... -->
5353
</entity>
@@ -72,8 +72,8 @@ entities, ordered alphabetically by name.
7272

7373
.. code-block:: php
7474
75-
// src/AppBundle/Entity/ProductRepository.php
76-
namespace AppBundle\Entity;
75+
// src/AppBundle/Repository/ProductRepository.php
76+
namespace AppBundle\Repository;
7777
7878
use Doctrine\ORM\EntityRepository;
7979

‎security/entity_provider.rst

Copy file name to clipboardExpand all lines: security/entity_provider.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ For this entry, suppose that you already have a ``User`` entity inside an
5050
5151
/**
5252
* @ORM\Table(name="app_users")
53-
* @ORM\Entity(repositoryClass="AppBundle\Entity\UserRepository")
53+
* @ORM\Entity(repositoryClass="AppBundle\Repository\UserRepository")
5454
*/
5555
class User implements UserInterface, \Serializable
5656
{
@@ -428,8 +428,8 @@ To do this, make your ``UserRepository`` implement a special
428428
interface requires three methods: ``loadUserByUsername($username)``,
429429
``refreshUser(UserInterface $user)``, and ``supportsClass($class)``::
430430

431-
// src/AppBundle/Entity/UserRepository.php
432-
namespace AppBundle\Entity;
431+
// src/AppBundle/Repository/UserRepository.php
432+
namespace AppBundle\Repository;
433433

434434
use Symfony\Component\Security\Core\User\UserInterface;
435435
use Symfony\Component\Security\Core\User\UserProviderInterface;

‎service_container/parent_services.rst

Copy file name to clipboardExpand all lines: service_container/parent_services.rst
+14-14Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ have related classes that share some of the same dependencies. For example,
99
you may have multiple repository classes which need the
1010
``doctrine.entity_manager`` service and an optional ``logger`` service::
1111

12-
// src/AppBundle/Doctrine/BaseDoctrineRepository.php
13-
namespace AppBundle\Doctrine;
12+
// src/AppBundle/Repository/BaseDoctrineRepository.php
13+
namespace AppBundle\Repository;
1414

1515
// ...
1616
abstract class BaseDoctrineRepository
@@ -48,12 +48,12 @@ duplicated service definitions:
4848
- [setLogger, ['@logger']]
4949
5050
app.user_repository:
51-
class: AppBundle\Doctrine\DoctrineUserRepository
51+
class: AppBundle\Repository\DoctrineUserRepository
5252
# extend the app.base_doctrine_repository service
5353
parent: app.base_doctrine_repository
5454
5555
app.post_repository:
56-
class: AppBundle\Doctrine\DoctrinePostRepository
56+
class: AppBundle\Repository\DoctrinePostRepository
5757
parent: app.base_doctrine_repository
5858
5959
# ...
@@ -77,12 +77,12 @@ duplicated service definitions:
7777
7878
<!-- extends the app.base_doctrine_repository service -->
7979
<service id="app.user_repository"
80-
class="AppBundle\Doctrine\DoctrineUserRepository"
80+
class="AppBundle\Repository\DoctrineUserRepository"
8181
parent="app.base_doctrine_repository"
8282
/>
8383
8484
<service id="app.post_repository"
85-
class="AppBundle\Doctrine\DoctrineUserRepository"
85+
class="AppBundle\Repository\DoctrineUserRepository"
8686
parent="app.base_doctrine_repository"
8787
/>
8888
@@ -103,11 +103,11 @@ duplicated service definitions:
103103
104104
// extend the app.base_doctrine_repository service
105105
$definition = new DefinitionDecorator('app.base_doctrine_repository');
106-
$definition->setClass('AppBundle\Doctrine\DoctrineUserRepository');
106+
$definition->setClass('AppBundle\Repository\DoctrineUserRepository');
107107
$container->setDefinition('app.user_repository', $definition);
108108
109109
$definition = new DefinitionDecorator('app.base_doctrine_repository');
110-
$definition->setClass('AppBundle\Doctrine\DoctrinePostRepository');
110+
$definition->setClass('AppBundle\Repository\DoctrinePostRepository');
111111
$container->setDefinition('app.post_repository', $definition);
112112
113113
// ...
@@ -144,7 +144,7 @@ in the child class:
144144
# ...
145145
146146
app.user_repository:
147-
class: AppBundle\Doctrine\DoctrineUserRepository
147+
class: AppBundle\Repository\DoctrineUserRepository
148148
parent: app.base_doctrine_repository
149149
150150
# overrides the public setting of the parent service
@@ -155,7 +155,7 @@ in the child class:
155155
arguments: ['@app.username_checker']
156156
157157
app.post_repository:
158-
class: AppBundle\Doctrine\DoctrinePostRepository
158+
class: AppBundle\Repository\DoctrinePostRepository
159159
parent: app.base_doctrine_repository
160160
161161
# overrides the first argument (using the special index_N key)
@@ -174,7 +174,7 @@ in the child class:
174174
175175
<!-- overrides the public setting of the parent service -->
176176
<service id="app.user_repository"
177-
class="AppBundle\Doctrine\DoctrineUserRepository"
177+
class="AppBundle\Repository\DoctrineUserRepository"
178178
parent="app.base_doctrine_repository"
179179
public="false"
180180
>
@@ -184,7 +184,7 @@ in the child class:
184184
</service>
185185
186186
<service id="app.post_repository"
187-
class="AppBundle\Doctrine\DoctrineUserRepository"
187+
class="AppBundle\Repository\DoctrineUserRepository"
188188
parent="app.base_doctrine_repository"
189189
>
190190
<!-- overrides the first argument (using the index attribute) -->
@@ -202,15 +202,15 @@ in the child class:
202202
// ...
203203
204204
$definition = new DefinitionDecorator('app.base_doctrine_repository');
205-
$definition->setClass('AppBundle\Doctrine\DoctrineUserRepository');
205+
$definition->setClass('AppBundle\Repository\DoctrineUserRepository');
206206
// overrides the public setting of the parent service
207207
$definition->setPublic(false);
208208
// appends the '@app.username_checker' argument to the parent argument list
209209
$definition->addArgument(new Reference('app.username_checker'));
210210
$container->setDefinition('app.user_repository', $definition);
211211
212212
$definition = new DefinitionDecorator('app.base_doctrine_repository');
213-
$definition->setClass('AppBundle\Doctrine\DoctrinePostRepository');
213+
$definition->setClass('AppBundle\Repository\DoctrinePostRepository');
214214
// overrides the first argument
215215
$definition->replaceArgument(0, new Reference('doctrine.custom_entity_manager'));
216216
$container->setDefinition('app.post_repository', $definition);

‎testing/doctrine.rst

Copy file name to clipboardExpand all lines: testing/doctrine.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ If you need to actually execute a query, you will need to boot the kernel
1818
to get a valid connection. In this case, you'll extend the ``KernelTestCase``,
1919
which makes all of this quite easy::
2020

21-
// src/AppBundle/Tests/Entity/ProductRepositoryFunctionalTest.php
22-
namespace AppBundle\Tests\Entity;
21+
// src/AppBundle/Tests/Repository/ProductRepositoryFunctionalTest.php
22+
namespace AppBundle\Tests\Repository;
2323

2424
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
2525

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.