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 ca71481

Browse filesBrowse files
committed
minor symfony#7585 Update parent_services for tip consistency (matthieu88160, javiereguiluz)
This PR was submitted for the 3.2 branch but it was merged into the 2.7 branch instead (closes symfony#7585). Discussion ---------- Update parent_services for tip consistency Currently the first page tip explain that the created service class extends the BaseDoctrineRepository but it is not represented by the code samples. Simply adding class declaration example for tip consistency and user reading improvement. Commits ------- 45a44f3 Fixed a typo 977142c Fixed a typo 6855572 Update parent_services for tip consistency
2 parents 7afd581 + 45a44f3 commit ca71481
Copy full SHA for ca71481

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+24
-0
lines changed

‎service_container/parent_services.rst

Copy file name to clipboardExpand all lines: service_container/parent_services.rst
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,30 @@ you may have multiple repository classes which need the
3131
// ...
3232
}
3333

34+
Your child service classes may look like::
35+
36+
// src/AppBundle/Repository/DoctrineUserRepository.php
37+
namespace AppBundle\Repository;
38+
39+
use AppBundle\Repository\BaseDoctrineRepository
40+
41+
// ...
42+
class DoctrineUserRepository extends BaseDoctrineRepository
43+
{
44+
// ...
45+
}
46+
47+
// src/AppBundle/Repository/DoctrinePostRepository.php
48+
namespace AppBundle\Repository;
49+
50+
use AppBundle\Repository\BaseDoctrineRepository
51+
52+
// ...
53+
class DoctrinePostRepository extends BaseDoctrineRepository
54+
{
55+
// ...
56+
}
57+
3458
Just as you use PHP inheritance to avoid duplication in your PHP code, the
3559
service container allows you to extend parent services in order to avoid
3660
duplicated service definitions:

0 commit comments

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