@@ -58,11 +58,11 @@ done in the constructor.
58
58
59
59
.. code-block :: php
60
60
61
- private $security_context ;
61
+ private $securityContext ;
62
62
63
- public function __construct(SecurityContext $security_context )
63
+ public function __construct(SecurityContext $securityContext )
64
64
{
65
- $this->security_context = $security_context ;
65
+ $this->securityContext = $securityContext ;
66
66
}
67
67
68
68
.. note ::
@@ -81,11 +81,11 @@ our listener::
81
81
82
82
class FriendMessageFormType extends AbstractType
83
83
{
84
- private $security_context ;
84
+ private $securityContext ;
85
85
86
- public function __construct(SecurityContext $security_context )
86
+ public function __construct(SecurityContext $securityContext )
87
87
{
88
- $this->security_context = $security_context ;
88
+ $this->securityContext = $securityContext ;
89
89
}
90
90
91
91
public function buildForm(FormBuilderInterface $builder, array $options)
@@ -94,22 +94,22 @@ our listener::
94
94
->add('subject', 'text')
95
95
->add('body', 'textarea')
96
96
;
97
- $user = $this->security_context ->getToken()->getUser();
97
+ $user = $this->securityContext ->getToken()->getUser();
98
98
$factory = $builder->getFormFactory();
99
99
100
100
$builder->addEventListener(
101
101
FormEvents::PRE_SET_DATA,
102
102
function(FormEvent $event) use($user, $factory){
103
103
$form = $event->getForm();
104
- $user_id = $user->getId();
104
+ $userId = $user->getId();
105
105
106
106
$form_options = [
107
107
'class' => 'Acme\WhateverBundle\Document\User',
108
108
'multiple' => false,
109
109
'expanded' => false,
110
110
'property' => 'fullName',
111
- 'query_builder' => function(DocumentRepository $dr) use ($user_id ) {
112
- return $dr->createQueryBuilder()->field('friends.$id')->equals(new \MongoId($user_id ));
111
+ 'query_builder' => function(DocumentRepository $dr) use ($userId ) {
112
+ return $dr->createQueryBuilder()->field('friends.$id')->equals(new \MongoId($userId ));
113
113
}
114
114
];
115
115
0 commit comments