Skip to content

Commit

Permalink
Merged main in organizers
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Destoop committed Oct 11, 2023
2 parents ffaa353 + 3874e25 commit 93d375d
Show file tree
Hide file tree
Showing 11 changed files with 353 additions and 22 deletions.
5 changes: 5 additions & 0 deletions src/SearchClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ public function searchOffers(SearchQueryInterface $searchQuery): PagedCollection
return $this->search($searchQuery, 'offers');
}

public function searchOrganizers(SearchQueryInterface $searchQuery): PagedCollection
{
return $this->search($searchQuery, 'organizers');
}

private function search(SearchQueryInterface $searchQuery, $type): PagedCollection
{
$options = [
Expand Down
2 changes: 2 additions & 0 deletions src/SearchClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ public function searchEvents(SearchQueryInterface $searchQuery): PagedCollection
public function searchPlaces(SearchQueryInterface $searchQuery): PagedCollection;

public function searchOffers(SearchQueryInterface $searchQuery): PagedCollection;

public function searchOrganizers(SearchQueryInterface $searchQuery): PagedCollection;
}
3 changes: 3 additions & 0 deletions src/Serializer/Handler/CollectionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use CultuurNet\SearchV3\Serializer\Serializer;
use CultuurNet\SearchV3\ValueObjects\Collection;
use CultuurNet\SearchV3\ValueObjects\Event;
use CultuurNet\SearchV3\ValueObjects\Organizer;
use CultuurNet\SearchV3\ValueObjects\Place;
use JMS\Serializer\Context;
use JMS\Serializer\GraphNavigator;
Expand All @@ -18,11 +19,13 @@ final class CollectionHandler implements SubscribingHandlerInterface
private $contextMapping = [
'/contexts/event' => Event::class,
'/contexts/place' => Place::class,
'/contexts/organizer' => Organizer::class,
];

private $typeMapping = [
'Event' => Event::class,
'Place' => Place::class,
'Organizer' => Organizer::class,
];

public static function getSubscribingMethods(): array
Expand Down
8 changes: 4 additions & 4 deletions src/ValueObjects/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(
$this->streetAddress = $streetAddress;
}

public function getAddressCountry(): string
public function getAddressCountry(): ?string
{
return $this->addressCountry;
}
Expand All @@ -48,7 +48,7 @@ public function setAddressCountry(string $addressCountry): void
$this->addressCountry = $addressCountry;
}

public function getAddressLocality(): string
public function getAddressLocality(): ?string
{
return $this->addressLocality;
}
Expand All @@ -58,7 +58,7 @@ public function setAddressLocality(string $addressLocality): void
$this->addressLocality = $addressLocality;
}

public function getPostalCode(): string
public function getPostalCode(): ?string
{
return $this->postalCode;
}
Expand All @@ -68,7 +68,7 @@ public function setPostalCode(string $postalCode): void
$this->postalCode = $postalCode;
}

public function getStreetAddress(): string
public function getStreetAddress(): ?string
{
return $this->streetAddress;
}
Expand Down
15 changes: 15 additions & 0 deletions src/ValueObjects/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,19 @@ public function setOnlineUrl(?string $onlineUrl): void
{
$this->onlineUrl = $onlineUrl;
}

public function isAttendanceModeOnline(): bool
{
return null !== $this->getAttendanceMode() && $this->getAttendanceMode() === 'online';
}

public function isAttendanceModeOffline(): bool
{
return null !== $this->getAttendanceMode() && $this->getAttendanceMode() === 'offline';
}

public function isAttendanceModeMixed(): bool
{
return null !== $this->getAttendanceMode() && $this->getAttendanceMode() === 'mixed';
}
}
4 changes: 2 additions & 2 deletions src/ValueObjects/GeoPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ final class GeoPoint
{
/**
* @var float|null
* @Type("string")
* @Type("float")
*/
private $latitude;

/**
* @var float|null
* @Type("string")
* @Type("float")
*/
private $longitude;

Expand Down
40 changes: 40 additions & 0 deletions src/ValueObjects/MediaObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ final class MediaObject
*/
private $id;

/**
* @var string|null
* @Type("string")
* @SerializedName("id")
*/
private $uuid;

/**
* @var string|null
* @Type("string")
Expand All @@ -40,6 +47,18 @@ final class MediaObject
*/
private $copyrightHolder;

/**
* @var string|null
* @Type("string")
*/
private $inLanguage;

/**
* @var string|null
* @Type("string")
*/
private $language;

public function getId(): string
{
return $this->id;
Expand All @@ -50,6 +69,16 @@ public function setId(string $id): void
$this->id = $id;
}

public function getUuid(): ?string
{
return $this->uuid;
}

public function setUuid(?string $uuid): void
{
$this->uuid = $uuid;
}

public function getContentUrl(): ?string
{
return $this->contentUrl;
Expand Down Expand Up @@ -89,4 +118,15 @@ public function setCopyrightHolder(string $copyrightHolder): void
{
$this->copyrightHolder = $copyrightHolder;
}

public function setLanguage(string $language): void
{
$this->language = $language;
$this->inLanguage = $language;
}

public function getLanguage(): ?string
{
return $this->language ?? $this->inLanguage;
}
}
Loading

0 comments on commit 93d375d

Please sign in to comment.