@@ -114,7 +114,6 @@ Example:
114
114
abstract: true
115
115
` ` `
116
116
117
-
118
117
# # Forcing a Nullable Property
119
118
120
119
Force a property to be (or to not be) `nullable`.
@@ -135,13 +134,12 @@ The `@Assert\NotNull` constrain is automatically added.
135
134
<?php
136
135
137
136
/**
138
- * @var string The name of the item.
137
+ * The name of the item.
139
138
*
140
139
* @ORM\C olumn
141
- * @Assert\T ype(type="string")
142
140
* @Assert\N otNull
143
141
*/
144
- private $name;
142
+ private string $name;
145
143
` ` `
146
144
147
145
# # Forcing a Unique Property
@@ -178,12 +176,12 @@ use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
178
176
class Person
179
177
{
180
178
/**
181
- * @var string Email address.
179
+ * Email address.
182
180
*
183
181
* @ORM\C olumn
184
182
* @Assert\E mail
185
183
*/
186
- private $email;
184
+ private string $email;
187
185
` ` `
188
186
189
187
# # Making a Property Read-Only
@@ -251,14 +249,16 @@ use Symfony\Component\Serializer\Annotation\Groups;
251
249
class Person
252
250
{
253
251
/**
254
- * @var string The name of the item.
252
+ * The name of the item.
253
+ *
254
+ * @see https://schema.org/name
255
255
*
256
256
* @ORM\C olumn(nullable=true)
257
257
* @Assert\T ype(type="string")
258
258
* @Iri("https://schema.org/name")
259
259
* @Groups({"public"})
260
260
*/
261
- private $name;
261
+ private string $name;
262
262
263
263
` ` `
264
264
@@ -304,12 +304,14 @@ use Doctrine\ORM\Mapping as ORM;
304
304
class Product
305
305
{
306
306
/**
307
- * @var QuantitativeValue|null the weight of the product or person
307
+ * the weight of the product or person
308
+ *
309
+ * @see http://schema.org/weight
308
310
*
309
311
* @ORM\E mbedded(class="App\E ntity\Q uantitativeValue", columnPrefix="weight_")
310
312
* @ApiProperty(iri="http://schema.org/weight")
311
313
*/
312
- private $weight;
314
+ private ?QuantitativeValue $weight = null ;
313
315
314
316
` ` `
315
317
@@ -479,7 +481,7 @@ You can also use any other vocabulary. Check the [Linked Open Vocabularies](http
479
481
480
482
For instance, to generate a data model from the [Video Game Ontology](http://purl.org/net/VideoGameOntology), use the following config file :
481
483
482
- ` ` `
484
+ ` ` ` yaml
483
485
rdfa:
484
486
- http://vocab.linkeddata.es/vgo/GameOntologyv3.owl # The URL of the vocabulary definition
485
487
@@ -508,33 +510,35 @@ header: |
508
510
/*
509
511
* This file is part of the Ecommerce package.
510
512
*
511
- * (c) Kévin Dunglas <[email protected] >
513
+ * (c) Kévin Dunglas <[email protected] >
512
514
*
513
515
* For the full copyright and license information, please view the LICENSE
514
516
* file that was distributed with this source code.
515
517
*/
516
518
` ` `
517
519
518
-
519
520
# # Full Configuration Reference
520
521
521
522
` ` ` yaml
522
523
config:
523
524
524
- # RDFa files
525
- rdfa :
525
+ # RDF vocabularies
526
+ vocabularies :
526
527
527
528
# Prototype
528
529
-
529
530
530
- # RDFa URI to use
531
- uri: 'https://schema.org/docs/schema_org_rdfa.html ' # Example: https://schema.org/docs/schema_org_rdfa.html
531
+ # RDF vocabulary to use
532
+ uri: 'https://schema.org/version/latest/schemaorg-current-http.rdf ' # Example: ' https://schema.org/version/latest/schemaorg-current-http.rdf'
532
533
533
- # RDFa URI data format
534
+ # RDF vocabulary format
534
535
format: null # Example: rdfxml
535
536
536
- # OWL relation files to use
537
- relations:
537
+ # Namespace of the vocabulary to import
538
+ vocabularyNamespace: 'http://schema.org/' # Example: 'http://www.w3.org/ns/activitystreams#'
539
+
540
+ # OWL relation files containing cardinality information in the GoodRelations format
541
+ relations: # Example: 'https://purl.org/goodrelations/v1.owl'
538
542
539
543
# Default:
540
544
- https://purl.org/goodrelations/v1.owl
@@ -554,26 +558,32 @@ config:
554
558
# Is the ID writable? Only applicable if "generationStrategy" is "uuid".
555
559
writable: false
556
560
561
+ # Set to "child" to generate the id on the child class, and "parent" to use the parent class instead.
562
+ onClass: child # One of "child"; "parent"
563
+
557
564
# Generate interfaces and use Doctrine's Resolve Target Entity feature
558
565
useInterface: false
559
566
560
567
# Emit a warning if a property is not derived from GoodRelations
561
568
checkIsGoodRelations: false
562
569
563
570
# A license or any text to use as header of generated files
564
- header: false # Example: // (c) Kévin Dunglas <[email protected] >
571
+ header: false # Example: ' // (c) Kévin Dunglas <[email protected] >'
565
572
566
573
# PHP namespaces
567
574
namespaces:
568
575
576
+ # The global namespace's prefix
577
+ prefix: null # Example: App\
578
+
569
579
# The namespace of the generated entities
570
- entity: App\E ntity # Example: Acme \E ntity
580
+ entity: App\E ntity # Example: App \E ntity
571
581
572
582
# The namespace of the generated enumerations
573
- enum: App\E num # Example: Acme \E num
583
+ enum: App\E num # Example: App \E num
574
584
575
585
# The namespace of the generated interfaces
576
- interface: App\M odel # Example: Acme \M odel
586
+ interface: App\M odel # Example: App \M odel
577
587
578
588
# Doctrine
579
589
doctrine:
@@ -584,14 +594,17 @@ config:
584
594
# The Resolve Target Entity Listener config file pass
585
595
resolveTargetEntityConfigPath: null
586
596
597
+ # Doctrine inheritance annotations (if set, no other annotations are generated)
598
+ inheritanceAnnotations: []
599
+
587
600
# Symfony Validator Component
588
601
validator:
589
602
590
603
# Generate @Assert\T ype annotation
591
604
assertType: false
592
605
593
606
# The value of the phpDoc's @author annotation
594
- author: false # Example: Kévin Dunglas <[email protected] >
607
+ author: false # Example: ' Kévin Dunglas <[email protected] >'
595
608
596
609
# Visibility of entities fields
597
610
fieldVisibility: private # One of "private"; "protected"; "public"
@@ -601,15 +614,25 @@ config:
601
614
602
615
# Set this flag to true to generate fluent setter, adder and remover methods
603
616
fluentMutatorMethods: false
617
+ rangeMapping:
618
+
619
+ # Prototype
620
+ name: ~
604
621
605
- # Schema.org's types to use
622
+ # Generate all types, even if an explicit configuration exists
623
+ allTypes: false
624
+
625
+ # Types to import from the vocabulary
606
626
types:
607
627
608
628
# Prototype
609
629
id:
610
630
611
- # Namespace of the vocabulary the type belongs to.
612
- vocabularyNamespace: 'http://schema.org/'
631
+ # Exclude this type, even if "allTypes" is set to true"
632
+ exclude: false
633
+
634
+ # Namespace of the vocabulary of this type (defaults to the global "vocabularyNamespace" entry)
635
+ vocabularyNamespace: null # Example: 'http://www.w3.org/ns/activitystreams#'
613
636
614
637
# Is the class abstract? (null to guess)
615
638
abstract: null
@@ -627,8 +650,8 @@ config:
627
650
interface: null
628
651
doctrine:
629
652
630
- # The Doctrine inheritance mapping type (override the guessed one )
631
- inheritanceMapping : null
653
+ # Doctrine annotations (if set, no other annotations are generated )
654
+ annotations : []
632
655
633
656
# The parent class, set to false for a top level class
634
657
parent: false
@@ -645,6 +668,9 @@ config:
645
668
# Prototype
646
669
id:
647
670
671
+ # Exclude this property, even if "allProperties" is set to true"
672
+ exclude: false
673
+
648
674
# The property range
649
675
range: null # Example: Offer
650
676
@@ -653,11 +679,17 @@ config:
653
679
cardinality: unknown # One of "(0..1)"; "(0..*)"; "(1..1)"; "(1..*)"; "(*..0)"; "(*..1)"; "(*..*)"; "unknown"
654
680
655
681
# The doctrine column annotation content
656
- ormColumn: null # Example: type="decimal", precision=5, scale=1, options={"comment" = "my comment"}
682
+ ormColumn: null # Example: ' type="decimal", precision=5, scale=1, options={"comment" = "my comment"}'
657
683
658
684
# Symfony Serialization Groups
659
685
groups: []
660
686
687
+ # The doctrine mapped by attribute
688
+ mappedBy: null # Example: partOfSeason
689
+
690
+ # The doctrine inversed by attribute
691
+ inversedBy: null # Example: episodes
692
+
661
693
# Is the property readable?
662
694
readable: true
663
695
@@ -674,7 +706,7 @@ config:
674
706
embedded: false
675
707
676
708
# The property columnPrefix
677
- columnPrefix: false # Example: "weight_"
709
+ columnPrefix: false
678
710
679
711
# Annotation generators to use
680
712
annotationGenerators:
@@ -685,4 +717,7 @@ config:
685
717
- ApiPlatform\S chemaGenerator\A nnotationGenerator\A piPlatformCoreAnnotationGenerator
686
718
- ApiPlatform\S chemaGenerator\A nnotationGenerator\C onstraintAnnotationGenerator
687
719
- ApiPlatform\S chemaGenerator\A nnotationGenerator\S erializerGroupsAnnotationGenerator
720
+
721
+ # Directories for custom generator twig templates
722
+ generatorTemplates: []
688
723
` ` `
0 commit comments