src/Event/ReadModel/JSONLD/CdbXMLImporter.php
public function documentWithCdbXML(
        $base,
        \CultureFeed_Cdb_Item_Event $event,
        PlaceServiceInterface $placeManager,
        OrganizerServiceInterface $organizerManager,
        SluggerInterface $slugger
    ) {
        $jsonLD = clone $base;

        $detail = null;

        $details = $event->getDetails();

        foreach ($details as $languageDetail) {
            $language = $languageDetail->getLanguage();

            // The first language detail found will be used to retrieve
            // properties from which in UDB3 are not any longer considered
            // to be language specific.
            if (!$detail) {
                $detail = $languageDetail;
            }

            $jsonLD->name[$language] = $languageDetail->getTitle();

            $this->importDescription($languageDetail, $jsonLD, $language);
        }

        $this->cdbXMLItemBaseImporter->importAvailable($event, $jsonLD);

        $labelImporter = new LabelImporter();
        $labelImporter->importLabels($event, $jsonLD);

        $jsonLD->calendarSummary = $detail->getCalendarSummary();

        $this->importLocation($event, $placeManager, $jsonLD);

        $this->importOrganizer($event, $organizerManager, $jsonLD);

        if ($event->getContactInfo()) {
            $this->cdbXmlContactInfoImporter->importBookingInfo(
                $jsonLD,
                $event->getContactInfo(),
                $detail->getPrice(),
                $event->getBookingPeriod()
            );

            $this->cdbXmlContactInfoImporter->importContactPoint(
                $jsonLD,
                $event->getContactInfo()
            );
        }

        $this->cdbXMLItemBaseImporter->importPriceInfo($details, $jsonLD);

        $this->importTerms($event, $jsonLD);

        $this->cdbXMLItemBaseImporter->importPublicationInfo($event, $jsonLD);

        $calendar = $this->calendarFactory->createFromCdbCalendar($event->getCalendar());
        $jsonLD = (object)array_merge((array)$jsonLD, $calendar->toJsonLd());

        $this->importTypicalAgeRange($event, $jsonLD);

        $this->importPerformers($detail, $jsonLD);

        $this->importUitInVlaanderenReference($event, $slugger, $jsonLD);

        $this->cdbXMLItemBaseImporter->importExternalId($event, $jsonLD);

        $this->importSeeAlso($event, $jsonLD);

        $this->cdbXMLItemBaseImporter->importWorkflowStatus($event, $jsonLD);

        $this->importAudience($event, $jsonLD);

        return $jsonLD;
    }
public function documentWithCdbXML(
        $base,
        \CultureFeed_Cdb_Item_Event $event,
        PlaceServiceInterface $placeManager,
        OrganizerServiceInterface $organizerManager,
        SluggerInterface $slugger
    ) {
        $jsonLD = clone $base;

        $detail = null;

        $details = $event->getDetails();

        foreach ($details as $languageDetail) {
            $language = $languageDetail->getLanguage();

            // The first language detail found will be used to retrieve
            // properties from which in UDB3 are not any longer considered
            // to be language specific.
            if (!$detail) {
                $detail = $languageDetail;
            }

            $jsonLD->name[$language] = $languageDetail->getTitle();

            $this->importDescription($languageDetail, $jsonLD, $language);
        }

        $this->cdbXMLItemBaseImporter->importAvailable($event, $jsonLD);

        $labelImporter = new LabelImporter();
        $labelImporter->importLabels($event, $jsonLD);

        $jsonLD->calendarSummary = $detail->getCalendarSummary();

        $this->importLocation($event, $placeManager, $jsonLD);

        $this->importOrganizer($event, $organizerManager, $jsonLD);

        if ($event->getContactInfo()) {
            $this->cdbXmlContactInfoImporter->importBookingInfo(
                $jsonLD,
                $event->getContactInfo(),
                $detail->getPrice(),
                $event->getBookingPeriod()
            );

            $this->cdbXmlContactInfoImporter->importContactPoint(
                $jsonLD,
                $event->getContactInfo()
            );
        }

        $this->cdbXMLItemBaseImporter->importPriceInfo($details, $jsonLD);

        $this->importTerms($event, $jsonLD);

        $this->cdbXMLItemBaseImporter->importPublicationInfo($event, $jsonLD);

        $calendar = $this->calendarFactory->createFromCdbCalendar($event->getCalendar());
        $jsonLD = (object)array_merge((array)$jsonLD, $calendar->toJsonLd());

        $this->importTypicalAgeRange($event, $jsonLD);

        $this->importPerformers($detail, $jsonLD);

        $this->importUitInVlaanderenReference($event, $slugger, $jsonLD);

        $this->cdbXMLItemBaseImporter->importExternalId($event, $jsonLD);

        $this->importSeeAlso($event, $jsonLD);

        $this->cdbXMLItemBaseImporter->importWorkflowStatus($event, $jsonLD);

        $this->importAudience($event, $jsonLD);

        return $jsonLD;
    }
public function documentWithCdbXML ( $ base , \ CultureFeed_Cdb_Item_Event $ event , PlaceServiceInterface $ placeManager , OrganizerServiceInterface $ organizerManager , SluggerInterface $ slugger ) { $ jsonLD = clone $ base ; $ detail = null ; $ details = $ event -> getDetails ( ) ; foreach ( $ details as $ languageDetail ) { $ language = $ languageDetail -> getLanguage ( ) ; // The first language detail found will be used to retrieve // properties from which in UDB3 are not any longer considered // to be language specific. if ( ! $ detail ) { $ detail = $ languageDetail ; } $ jsonLD -> name [ $ language ] = $ languageDetail -> getTitle ( ) ; $ this -> importDescription ( $ languageDetail , $ jsonLD , $ language ) ; } $ this -> cdbXMLItemBaseImporter -> importAvailable ( $ event , $ jsonLD ) ; $ labelImporter = new LabelImporter ( ) ; $ labelImporter -> importLabels ( $ event , $ jsonLD ) ; $ jsonLD -> calendarSummary = $ detail -> getCalendarSummary ( ) ; $ this -> importLocation ( $ event , $ placeManager , $ jsonLD ) ; $ this -> importOrganizer ( $ event , $ organizerManager , $ jsonLD ) ; if ( $ event -> getContactInfo ( ) ) { $ this -> cdbXmlContactInfoImporter -> importBookingInfo ( $ jsonLD , $ event -> getContactInfo ( ) , $ detail -> getPrice ( ) , $ event -> getBookingPeriod ( ) ) ; $ this -> cdbXmlContactInfoImporter -> importContactPoint ( $ jsonLD , $ event -> getContactInfo ( ) ) ; } $ this -> cdbXMLItemBaseImporter -> importPriceInfo ( $ details , $ jsonLD ) ; $ this -> importTerms ( $ event , $ jsonLD ) ; $ this -> cdbXMLItemBaseImporter -> importPublicationInfo ( $ event , $ jsonLD ) ; $ calendar = $ this -> calendarFactory -> createFromCdbCalendar ( $ event -> getCalendar ( ) ) ; $ jsonLD = ( object ) array_merge ( ( array ) $ jsonLD , $ calendar -> toJsonLd ( ) ) ; $ this -> importTypicalAgeRange ( $ event , $ jsonLD ) ; $ this -> importPerformers ( $ detail , $ jsonLD ) ; $ this -> importUitInVlaanderenReference ( $ event , $ slugger , $ jsonLD ) ; $ this -> cdbXMLItemBaseImporter -> importExternalId ( $ event , $ jsonLD ) ; $ this -> importSeeAlso ( $ event , $ jsonLD ) ; $ this -> cdbXMLItemBaseImporter -> importWorkflowStatus ( $ event , $ jsonLD ) ; $ this -> importAudience ( $ event , $ jsonLD ) ; return $ jsonLD ; }
Imports a UDB2 event into a UDB3 JSON-LD document.

@param \stdClass $base
The JSON-LD document to start from.
@param \CultureFeed_Cdb_Item_Event $event
The cultural event data from UDB2 to import.
@param PlaceServiceInterface $placeManager
The manager from which to retrieve the JSON-LD of a place.
@param OrganizerServiceInterface $organizerManager
The manager from which to retrieve the JSON-LD of an organizer.
@param SluggerInterface $slugger
The slugger that's used to generate a sameAs reference.

@return \stdClass
The document with the UDB2 event data merged in.
Imports a UDB2 event into a UDB3 JSON - LD document .