mirror of
https://github.com/symfony/symfony-docs.git
synced 2026-03-24 00:32:14 +01:00
Merge branch '6.4' into 7.2
* 6.4: Highligh 'extensions' instead of 'mimeTypes' for File constraint Update messenger.rst [Doctrine] Remove redundant example with attribute Changed text to mention one Product object instead of many [WebLink] Hint that prerender is deprecated
This commit is contained in:
@@ -77,11 +77,8 @@ so Symfony doesn't try to get/set its value from the related entity::
|
||||
'constraints' => [
|
||||
new File([
|
||||
'maxSize' => '1024k',
|
||||
'mimeTypes' => [
|
||||
'application/pdf',
|
||||
'application/x-pdf',
|
||||
],
|
||||
'mimeTypesMessage' => 'Please upload a valid PDF document',
|
||||
'extensions' => ['pdf'],
|
||||
'extensionsMessage' => 'Please upload a valid PDF document',
|
||||
])
|
||||
],
|
||||
])
|
||||
|
||||
@@ -501,7 +501,7 @@ following method to the ``ProductRepository`` class::
|
||||
}
|
||||
}
|
||||
|
||||
This will *still* return an array of ``Product`` objects. But now, when you call
|
||||
This will *still* return a ``Product`` object. But now, when you call
|
||||
``$product->getCategory()`` and use that data, no second query is made.
|
||||
|
||||
Now, you can use this method in your controller to query for a ``Product``
|
||||
|
||||
@@ -304,23 +304,6 @@ listener in the Symfony application by creating a new service for it and
|
||||
|
||||
.. configuration-block::
|
||||
|
||||
.. code-block:: php-attributes
|
||||
|
||||
// src/EventListener/SearchIndexer.php
|
||||
namespace App\EventListener;
|
||||
|
||||
use Doctrine\Bundle\DoctrineBundle\Attribute\AsDoctrineListener;
|
||||
use Doctrine\ORM\Event\PostPersistEventArgs;
|
||||
|
||||
#[AsDoctrineListener('postPersist'/*, 500, 'default'*/)]
|
||||
class SearchIndexer
|
||||
{
|
||||
public function postPersist(PostPersistEventArgs $event): void
|
||||
{
|
||||
// ...
|
||||
}
|
||||
}
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# config/services.yaml
|
||||
|
||||
@@ -1447,7 +1447,7 @@ RabbitMQ. Install it by running:
|
||||
|
||||
$ composer require symfony/amqp-messenger
|
||||
|
||||
The AMQP transport DSN may looks like this:
|
||||
The AMQP transport DSN may look like this:
|
||||
|
||||
.. code-block:: env
|
||||
|
||||
|
||||
@@ -146,7 +146,8 @@ The WebLink component provides the following Twig functions to send those hints:
|
||||
* ``prefetch()``: "identifies a resource that might be required by the next
|
||||
navigation, and that the user agent *should* fetch, such that the user agent
|
||||
can deliver a faster response once the resource is requested in the future".
|
||||
* ``prerender()``: "identifies a resource that might be required by the next
|
||||
* ``prerender()``: " **deprecated** and superseded by the `Speculation Rules API`_,
|
||||
identifies a resource that might be required by the next
|
||||
navigation, and that the user agent *should* fetch and execute, such that the
|
||||
user agent can deliver a faster response once the resource is requested later".
|
||||
|
||||
@@ -206,3 +207,4 @@ You can also add links to the HTTP response directly from controllers and servic
|
||||
.. _`Akamai`: https://http2.akamai.com/
|
||||
.. _`link defined in the HTML specification`: https://html.spec.whatwg.org/dev/links.html#linkTypes
|
||||
.. _`PSR-13`: https://www.php-fig.org/psr/psr-13/
|
||||
.. _`Speculation Rules API`: https://developer.mozilla.org/docs/Web/API/Speculation_Rules_API
|
||||
|
||||
Reference in New Issue
Block a user