@@ -293,35 +293,6 @@ Then, create your groups definition:
293
293
294
294
.. configuration-block ::
295
295
296
- .. code-block :: php-annotations
297
-
298
- namespace Acme;
299
-
300
- use Symfony\Component\Serializer\Annotation\Groups;
301
-
302
- class MyObj
303
- {
304
- /**
305
- * @Groups({"group1", "group2"})
306
- */
307
- public $foo;
308
-
309
- /**
310
- * @Groups({"group4"})
311
- */
312
- public $anotherProperty;
313
-
314
- /**
315
- * @Groups("group3")
316
- */
317
- public function getBar() // is* methods are also supported
318
- {
319
- return $this->bar;
320
- }
321
-
322
- // ...
323
- }
324
-
325
296
.. code-block :: php-attributes
326
297
327
298
namespace Acme;
@@ -467,22 +438,6 @@ Option 1: Using ``@Ignore`` Annotation
467
438
468
439
.. configuration-block ::
469
440
470
- .. code-block :: php-annotations
471
-
472
- namespace App\Model;
473
-
474
- use Symfony\Component\Serializer\Annotation\Ignore;
475
-
476
- class MyClass
477
- {
478
- public $foo;
479
-
480
- /**
481
- * @Ignore()
482
- */
483
- public $bar;
484
- }
485
-
486
441
.. code-block :: php-attributes
487
442
488
443
namespace App\Model;
@@ -697,27 +652,6 @@ defines a ``Person`` entity with a ``firstName`` property:
697
652
698
653
.. configuration-block ::
699
654
700
- .. code-block :: php-annotations
701
-
702
- namespace App\Entity;
703
-
704
- use Symfony\Component\Serializer\Annotation\SerializedName;
705
-
706
- class Person
707
- {
708
- /**
709
- * @SerializedName("customer_name")
710
- */
711
- private $firstName;
712
-
713
- public function __construct($firstName)
714
- {
715
- $this->firstName = $firstName;
716
- }
717
-
718
- // ...
719
- }
720
-
721
655
.. code-block :: php-attributes
722
656
723
657
namespace App\Entity;
@@ -1412,22 +1346,6 @@ Here, we set it to 2 for the ``$child`` property:
1412
1346
1413
1347
.. configuration-block ::
1414
1348
1415
- .. code-block :: php-annotations
1416
-
1417
- namespace Acme;
1418
-
1419
- use Symfony\Component\Serializer\Annotation\MaxDepth;
1420
-
1421
- class MyObj
1422
- {
1423
- /**
1424
- * @MaxDepth(2)
1425
- */
1426
- public $child;
1427
-
1428
- // ...
1429
- }
1430
-
1431
1349
.. code-block :: php-attributes
1432
1350
1433
1351
namespace Acme;
@@ -1501,9 +1419,7 @@ having unique identifiers::
1501
1419
{
1502
1420
public $id;
1503
1421
1504
- /**
1505
- * @MaxDepth(1)
1506
- */
1422
+ #[MaxDepth(1)]
1507
1423
public $child;
1508
1424
}
1509
1425
@@ -1735,23 +1651,6 @@ and ``BitBucketCodeRepository`` classes:
1735
1651
1736
1652
.. configuration-block ::
1737
1653
1738
- .. code-block :: php-annotations
1739
-
1740
- namespace App;
1741
-
1742
- use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
1743
-
1744
- /**
1745
- * @DiscriminatorMap(typeProperty="type", mapping={
1746
- * "github"="App\GitHubCodeRepository",
1747
- * "bitbucket"="App\BitBucketCodeRepository"
1748
- * })
1749
- */
1750
- abstract class CodeRepository
1751
- {
1752
- // ...
1753
- }
1754
-
1755
1654
.. code-block :: php-attributes
1756
1655
1757
1656
namespace App;
0 commit comments