Пример #1
0
 /**
  * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement $xmlElement)
  * @return CultureFeed_Cdb_Data_Address
  *
  * @throws Exception
  */
 public static function parseFromCdbXml(SimpleXMLElement $xmlElement)
 {
     $address = new CultureFeed_Cdb_Data_Address();
     if (!empty($xmlElement->physical)) {
         $address->setPhysicalAddress(CultureFeed_Cdb_Data_Address_PhysicalAddress::parseFromCdbXml($xmlElement->physical));
     }
     if (!empty($xmlElement->virtual)) {
         $address->setVirtualAddress(CultureFeed_Cdb_Data_Address_VirtualAddress::parseFromCdbXml($xmlElement->virtual));
     }
     if (!empty($xmlElement->label)) {
         $address->setLabel((string) $xmlElement->label);
     }
     return $address;
 }
Пример #2
0
 public function testCreateTestEvent20140108()
 {
     $event = new CultureFeed_Cdb_Item_Event();
     $event->setAvailableFrom('2014-01-08T00:00:00');
     $event->setAvailableTo('2014-02-21T00:00:00');
     $event->setCdbId('d53c2bc9-8f0e-4c9a-8457-77e8b3cab3d1');
     $event->setCreatedBy('*****@*****.**');
     $event->setCreationDate('2014-01-08T09:43:52');
     $event->setExternalId('CDB:c2156058-9393-4c95-8821-7787170527c0');
     $event->setIsParent(FALSE);
     $event->setLastUpdated('2014-01-08T09:46:41');
     $event->setLastUpdatedBy('*****@*****.**');
     $event->setOwner('CultuurNet Validatoren');
     $event->setPctComplete(95);
     $event->setPublished();
     $event->setValidator('CultuurNet Validatoren');
     $event->setWfStatus('approved');
     $event->setAgeFrom(5);
     $event->setPrivate(FALSE);
     $calender = new CultureFeed_Cdb_Data_Calendar_TimestampList();
     $calender->add(new CultureFeed_Cdb_Data_Calendar_Timestamp('2014-01-31', '12:00:00', '15:00:00'));
     $calender->add(new CultureFeed_Cdb_Data_Calendar_Timestamp('2014-02-20', '12:00:00', '15:00:00'));
     $event->setCalendar($calender);
     $categories = new CultureFeed_Cdb_Data_CategoryList();
     $categories->add(new CultureFeed_Cdb_Data_Category(CultureFeed_Cdb_Data_Category::CATEGORY_TYPE_THEME, '1.7.6.0.0', 'Griezelfilm of horror'));
     $categories->add(new CultureFeed_Cdb_Data_Category(CultureFeed_Cdb_Data_Category::CATEGORY_TYPE_PUBLICSCOPE, '6.0.0.0', 'Wijk of buurt'));
     $categories->add(new CultureFeed_Cdb_Data_Category(CultureFeed_Cdb_Data_Category::CATEGORY_TYPE_TARGET_AUDIENCE, '2.2.1.0.0', 'Vanaf kleuterleeftijd (3+)'));
     $categories->add(new CultureFeed_Cdb_Data_Category(CultureFeed_Cdb_Data_Category::CATEGORY_TYPE_FLANDERS_REGION, 'reg.1565', '1000 Brussel'));
     $categories->add(new CultureFeed_Cdb_Data_Category('umv', 'umv.7', 'Film'));
     $contactInfo = new CultureFeed_Cdb_Data_ContactInfo();
     $event->setContactInfo($contactInfo);
     $address = new CultureFeed_Cdb_Data_Address();
     $physicalAddress = new CultureFeed_Cdb_Data_Address_PhysicalAddress();
     $address->setPhysicalAddress($physicalAddress);
     $physicalAddress->setCity('Brussel');
     $physicalAddress->setCountry('BE');
     $geo = new CultureFeed_Cdb_Data_Address_GeoInformation('4.350000', '50.850000');
     $physicalAddress->setGeoInformation($geo);
     $physicalAddress->setStreet('Sint-Gislainstraat');
     $physicalAddress->setHouseNumber('62');
     $physicalAddress->setZip(1000);
     $contactInfo->addAddress($address);
     $mail = new CultureFeed_Cdb_Data_Mail('*****@*****.**');
     $contactInfo->addMail($mail);
     $phone = new CultureFeed_Cdb_Data_Phone('123');
     $contactInfo->addPhone($phone);
     $url = new CultureFeed_Cdb_Data_Url('http://www.test.com');
     $contactInfo->addUrl($url);
     $details = new CultureFeed_Cdb_Data_EventDetailList();
     $event->setDetails($details);
     $detailNl = new CultureFeed_Cdb_Data_EventDetail();
     $detailNl->setLanguage('nl');
     $detailNl->setCalendarSummary('vrij 31/01/14 van 12:00 tot 15:00 do 20/02/14 van 12:00 tot 15:00');
     $performers = new CultureFeed_Cdb_Data_PerformerList();
     $performers->add(new CultureFeed_Cdb_Data_Performer('Muzikant', 'Tim Vanhamel'));
     $performers->add(new CultureFeed_Cdb_Data_Performer('Director', 'Jon Dedonder'));
     $detailNl->setPerformers($performers);
     $details->add($detailNl);
     $media = $detailNl->getMedia();
     $media->rewind();
     $file = new CultureFeed_Cdb_Data_File();
     $file->setHLink('http://www.test.com');
     $file->setMediaType(CultureFeed_Cdb_Data_File::MEDIA_TYPE_IMAGEWEB);
     $file->setMain();
     $media->add($file);
     $file = new CultureFeed_Cdb_Data_File();
     $file->setCopyright('Zelf gemaakt');
     $file->setHLink('http://85.255.197.172/images/20140108/9554d6f6-bed1-4303-8d42-3fcec4601e0e.jpg');
     $file->setMediaType('', CultureFeed_Cdb_Data_File::MEDIA_TYPE_PHOTO);
     $file->setFileName('9554d6f6-bed1-4303-8d42-3fcec4601e0e.jpg');
     $media->add($file);
     $price = new CultureFeed_Cdb_Data_Price(4.0);
     $price->setDescription('Extra Korting voor vroegboekers');
     $detailNl->setPrice($price);
 }