Skip to content

Commit d03a8d0

Browse files
committed
Merge branch '4.0'
* 4.0: Mention the skeleton project when creating projects Include a reference to the namespace option Server version should be specified as a string Update setup.rst Event form modifications improvements Add createdAt property + setter and getter
2 parents 7fcae45 + 20aaa1c commit d03a8d0

File tree

5 files changed

+38
-3
lines changed

5 files changed

+38
-3
lines changed

components/serializer.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ exists in your project::
7070
private $age;
7171
private $name;
7272
private $sportsman;
73+
private $createdAt;
7374

7475
// Getters
7576
public function getName()
@@ -82,6 +83,11 @@ exists in your project::
8283
return $this->age;
8384
}
8485

86+
public function getCreatedAt()
87+
{
88+
return $this->createdAt;
89+
}
90+
8591
// Issers
8692
public function isSportsman()
8793
{
@@ -103,6 +109,11 @@ exists in your project::
103109
{
104110
$this->sportsman = $sportsman;
105111
}
112+
113+
public function setCreatedAt($createdAt)
114+
{
115+
$this->createdAt = $createdAt;
116+
}
106117
}
107118

108119
Now, if you want to serialize this object into JSON, you only need to

form/dynamic_form_modification.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,11 @@ callbacks only because in two different scenarios, the data that you can use is
502502
available in different events. Other than that, the listeners always perform
503503
exactly the same things on a given form.
504504

505+
.. tip::
506+
507+
The ``FormEvents::POST_SUBMIT`` event does not allow to modify the form
508+
the listener is bound to, but it allows to modify its parent.
509+
505510
One piece that is still missing is the client-side updating of your form after
506511
the sport is selected. This should be handled by making an AJAX call back to
507512
your application. Assume that you have a sport meetup creation controller::

form/events.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ View data Normalized data transformed using a view transformer
219219

220220
.. caution::
221221

222-
At this point, you cannot add or remove fields to the form.
222+
At this point, you cannot add or remove fields to the current form and its
223+
children.
223224

224225
.. sidebar:: ``FormEvents::POST_SUBMIT`` in the Form component
225226

reference/configuration/doctrine.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,21 @@ Full Default Configuration
134134
port: ~
135135
instance_class: ~
136136
class: ~
137+
namespace: ~
137138
metadata_cache_driver:
138139
type: array # Required
139140
host: ~
140141
port: ~
141142
instance_class: ~
142143
class: ~
144+
namespace: ~
143145
result_cache_driver:
144146
type: array # Required
145147
host: ~
146148
port: ~
147149
instance_class: ~
148150
class: ~
151+
namespace: ~
149152
connection: ~
150153
class_metadata_factory_name: Doctrine\ORM\Mapping\ClassMetadataFactory
151154
default_repository_class: Doctrine\ORM\EntityRepository
@@ -318,7 +321,7 @@ The following block shows all possible configuration keys:
318321
charset: UTF8
319322
logging: '%kernel.debug%'
320323
platform_service: App\DBAL\MyDatabasePlatformService
321-
server_version: 5.6
324+
server_version: '5.6'
322325
mapping_types:
323326
enum: string
324327
types:
@@ -369,6 +372,11 @@ The following block shows all possible configuration keys:
369372
to find your PostgreSQL version and ``mysql -V`` to get your MySQL
370373
version).
371374

375+
Always wrap the server version number with quotes to parse it as a string
376+
instead of a float number. Otherwise, the floating-point representation
377+
issues can make your version be considered a different number (e.g. ``5.6``
378+
will be rounded as ``5.5999999999999996447286321199499070644378662109375``).
379+
372380
If you don't define this option and you haven't created your database
373381
yet, you may get ``PDOException`` errors because Doctrine will try to
374382
guess the database server version automatically and none is available.

setup.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ This will create a new ``my-project`` directory, download some dependencies into
2323
it and even generate the basic directories and files you'll need to get started.
2424
In other words, your new app is ready!
2525

26+
.. tip::
27+
28+
The ``website-skeleton`` is optimized for traditional web applications. If
29+
you are building microservices, console applications or APIs, consider
30+
using the much simpler ``skeleton`` project:
31+
32+
.. code-block:: terminal
33+
34+
$ composer create-project symfony/skeleton my-project
35+
2636
Running your Symfony Application
2737
--------------------------------
2838

@@ -112,7 +122,7 @@ vulnerability. Run this command to install it in your application:
112122
.. code-block:: terminal
113123
114124
$ cd my-project/
115-
$ composer require sec-checker
125+
$ composer require sec-checker --dev
116126
117127
From now on, this utility will be run automatically whenever you install or
118128
update any dependency in the application. If a dependency contains a vulnerability,

0 commit comments

Comments
 (0)