diff --git a/composer.json b/composer.json index a4d40b87256a099029c56dc031a4a9923d135439..eef9e41b535a8d57fd8c3ca64898a5971239a52b 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "php": ">=7.3", "ext-json": "*", "api-platform/core": "^2.6", - "dbp/relay-base-person-bundle": "dev-main", + "dbp/relay-base-person-bundle": "^0.1.3", "dbp/relay-core-bundle": "^0.1.11", "symfony/framework-bundle": "^5.4" }, diff --git a/composer.lock b/composer.lock index 019af5d1b3882bcb228078f907c4a0d071415e14..a88955fbc3fcf2e8c087b2bbaba9ac14acb38e5b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7211b8b5c0a91436031cb216d95cbea6", + "content-hash": "0df1de6656e47e39e70adb1f054ff0ab", "packages": [ { "name": "api-platform/core", @@ -169,17 +169,11 @@ }, { "name": "dbp/relay-base-person-bundle", - "version": "dev-main", + "version": "v0.1.6", "source": { "type": "git", - "url": "https://gitlab.tugraz.at/dbp/relay/dbp-relay-base-person-bundle.git", - "reference": "003581b370018bb13a67d2d9a28fc21d914569f6" - }, - "dist": { - "type": "zip", - "url": "https://gitlab.tugraz.at/api/v4/projects/dbp%2Frelay%2Fdbp-relay-base-person-bundle/repository/archive.zip?sha=003581b370018bb13a67d2d9a28fc21d914569f6", - "reference": "003581b370018bb13a67d2d9a28fc21d914569f6", - "shasum": "" + "url": "git@gitlab.tugraz.at:dbp/relay/dbp-relay-base-person-bundle.git", + "reference": "aaae7b2cb9e6fbb22c116b777fde800312ad10ea" }, "require": { "api-platform/core": "^2.6.3", @@ -210,7 +204,6 @@ "symfony/phpunit-bridge": "^5.2", "vimeo/psalm": "^4.4" }, - "default-branch": true, "type": "symfony-bundle", "autoload": { "psr-4": { @@ -250,11 +243,7 @@ "license": [ "AGPL-3.0-or-later" ], - "support": { - "source": "https://gitlab.tugraz.at/dbp/relay/dbp-relay-base-person-bundle/-/tree/main", - "issues": "https://gitlab.tugraz.at/dbp/relay/dbp-relay-base-person-bundle/-/issues" - }, - "time": "2022-02-28T01:23:32+01:00" + "time": "2022-02-02T15:46:45+00:00" }, { "name": "dbp/relay-core-bundle", @@ -10087,9 +10076,7 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "dbp/relay-base-person-bundle": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/src/Entity/CourseTrait.php b/src/Entity/CourseTrait.php index c1fa6f0790c4f5f1e8be9933983872c7bffc8d2c..b36d1f016092571055bfd92b290a4f4fa3bd3f42 100644 --- a/src/Entity/CourseTrait.php +++ b/src/Entity/CourseTrait.php @@ -16,7 +16,7 @@ trait CourseTrait /** * @ApiProperty(iri="https://schema.org/name") - * @Groups({"Course:output"}) + * @Groups({"BaseCourse:output"}) * * @var string */ @@ -24,7 +24,7 @@ trait CourseTrait /** * @ApiProperty - * @Groups({"Course:output"}) + * @Groups({"BaseCourse:output"}) * * @var string */ @@ -32,12 +32,20 @@ trait CourseTrait /** * @ApiProperty(iri="https://schema.org/description") - * @Groups({"Course:output"}) + * @Groups({"BaseCourse:output"}) * * @var string */ private $description; + /** + * @ApiProperty(iri="https://schema.org/additionalProperty") + * @Groups({"BaseCourse:output"}) + * + * @var array + */ + private $localData; + public function getIdentifier(): string { return $this->identifier; @@ -77,4 +85,24 @@ trait CourseTrait { $this->description = $description; } + + /** + * Allows attaching local data to a Course object. + * + * @param ?mixed $value + */ + public function setLocalData(string $key, $value): void + { + $this->localData[$key] = $value; + } + + /** + * Gets local data from a Course object. + * + * @return ?mixed + */ + public function getLocalData(string $key) + { + return $this->localData[$key] ?? null; + } }