From 6802437e6990678e3b37666db5ddbb6fe7206f83 Mon Sep 17 00:00:00 2001 From: Ruben van der Linde Date: Sat, 1 Feb 2020 11:37:44 +0100 Subject: [PATCH] Added iri to property --- api/src/DataFixtures/AppFixtures.php | 27 ++++++++++++++++++--------- api/src/Entity/Property.php | 23 +++++++++++++++++++++++ 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/api/src/DataFixtures/AppFixtures.php b/api/src/DataFixtures/AppFixtures.php index 755c65d4..925f15fa 100644 --- a/api/src/DataFixtures/AppFixtures.php +++ b/api/src/DataFixtures/AppFixtures.php @@ -831,7 +831,7 @@ public function load(ObjectManager $manager) $stage1->setIcon('fas fa-ring'); $stage1->setSlug('ceremonie'); $stage1->setType('string'); - $stage1->setFormat('strin'); + $stage1->setFormat('string'); $stage1->setMaxLength('12'); $stage1->setMinLength('7'); $stage1->setEnum(['trouwen','partnerschap','omzetten']); @@ -846,7 +846,8 @@ public function load(ObjectManager $manager) $stage2->setIcon('fas fa-user-friends'); $stage2->setSlug('partner'); $stage2->setType('array'); - $stage2->setFormat('bsn'); + $stage2->setFormat('url'); + $stage2->setIri('irc/assent'); $stage2->setMinItems(2); $stage2->setMaxItems(2); $stage2->setRequired(true); @@ -860,7 +861,8 @@ public function load(ObjectManager $manager) $stage3->setIcon('fas fa-glass-cheers'); $stage3->setSlug('plechtigheid'); $stage3->setType('string'); - $stage3->setFormat('uri'); + $stage3->setFormat('url'); + $stage3->setIri('pdc/product'); $stage3->setDescription('Onder welke uri kunnen we de bestaande \'melding voorgenomen huwelijk\' terugvinden?'); $stage3->setRequestType($trouwenNL); $manager->persist($stage3); @@ -883,6 +885,7 @@ public function load(ObjectManager $manager) $stage5->setSlug('locatie'); $stage5->setType('string'); $stage5->setFormat('uri'); + $stage5->setIri('pdc/product'); $stage5->setMaxLength('255'); $stage5->setRequired(true); $stage5->setDescription('We gebruiken de order om de bestelling (bestaande uit locatie, ambtenaar en eventuele extra\'s) op te slaan'); @@ -895,7 +898,8 @@ public function load(ObjectManager $manager) $stage6->setIcon('fas fa-user-tie'); $stage6->setSlug('ambtenaar'); $stage6->setType('string'); - $stage6->setFormat('uri'); + $stage6->setFormat('url'); + $stage6->setIri('pdc/product'); $stage6->setMaxLength('255'); $stage6->setRequired(true); $stage6->setDescription('We gebruiken de order om de bestelling (bestaande uit locatie, ambtenaar en eventuele extra\'s) op te slaan'); @@ -908,7 +912,8 @@ public function load(ObjectManager $manager) $stage7->setIcon('fas fa-users'); $stage7->setSlug('getuige'); $stage7->setType('array'); - $stage7->setFormat('bsn'); + $stage7->setFormat('url'); + $stage7->setIri('irc/assent'); $stage7->setMinItems(2); $stage7->setMaxItems(4); $stage7->setRequired(true); @@ -922,7 +927,8 @@ public function load(ObjectManager $manager) $stage8->setIcon('fas fa-gift'); $stage8->setSlug('extra'); $stage8->setType('array'); - $stage8->setFormat('bsn'); + $stage8->setFormat('url'); + $stage8->setIri('pdc/product'); $stage8->setRequired(true); $stage8->setDescription('Wie zijn de getuigen van partner?'); $stage8->setRequestType($trouwenNL); @@ -934,7 +940,8 @@ public function load(ObjectManager $manager) $stage9->setIcon('fas fa-envelope'); $stage9->setSlug('melding'); $stage9->setType('string'); - $stage9->setFormat('uri'); + $stage9->setFormat('url'); + $stage9->setIri('vrc/request'); $stage9->setDescription('Onder welke uri kunnen we de bestaande \'melding voorgenomen huwelijk\' terugvinden?'); $stage9->setRequestType($trouwenNL); $manager->persist($stage9); @@ -945,7 +952,8 @@ public function load(ObjectManager $manager) $stage10->setIcon('fas fa-cash-register'); $stage10->setSlug('betalen'); $stage10->setType('string'); - $stage10->setFormat('uri'); + $stage10->setFormat('url'); + $stage10->setIri('orc/order'); $stage10->setDescription('Onder welke uri kunnen we de bestaande \'melding voorgenomen huwelijk\' terugvinden?'); $stage10->setRequestType($trouwenNL); $manager->persist($stage10); @@ -963,7 +971,8 @@ public function load(ObjectManager $manager) //$property->setId(''); $property->setTitle('Order'); $property->setType('string'); - $property->setFormat('uri'); + $property->setFormat('url'); + $property->setIri('orc/order'); $property->setMaxLength('255'); $property->setRequired(true); $property->setDescription('We gebruiken de order om de bestelling (bestaande uit locatie, ambtenaar en eventuele extra\'s) op te slaan'); diff --git a/api/src/Entity/Property.php b/api/src/Entity/Property.php index a5a26d95..cfc38ab5 100644 --- a/api/src/Entity/Property.php +++ b/api/src/Entity/Property.php @@ -103,6 +103,17 @@ class Property * @ORM\Column(type="string", length=255, nullable=true) */ private $format; + + /** + * @var string The iri type of the property used to standarize datas + * + * @example https://schema.org/name + * + * @Assert\Length(max = 255) + * @Groups({"read", "write"}) + * @ORM\Column(type="string", length=255, nullable=true) + */ + private $iri; /** * @var string *Can only be used in combination with type integer* Specifies a number where the value should be a multiple of, e.g. a multiple of 2 would validate 2,4 and 6 but would prevent 5 @@ -958,6 +969,18 @@ public function setFormat(?string $format): self return $this; } + + public function getIri(): ?string + { + return $this->iri; + } + + public function setIri(?string $iri): self + { + $this->iri = $iri; + + return $this; + } public function getNullable(): ?bool {