/**
  * Creates a new instance of Feedback using Smark.io supplierId+externalId as lead key
  *
  * @param $api_token string your API token
  * @param $supplierId string|int the identifier of the supplier in Smark.io
  * @param $externalId string|int the identifier of the lead for the supplier.
  * @param $status string the status of the lead
  * @return Feedback
  */
 public static function createWithSupplierExternalId($api_token, $supplierId, $externalId, $status)
 {
     $feedback = new self($api_token);
     $feedback->setSupplierId($supplierId);
     $feedback->setExternalId($externalId);
     $feedback->setStatus($status);
     return $feedback;
 }
Example #2
0
 /**
  * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement $xmlElement)
  * @return CultureFeed_Cdb_Item_Actor
  */
 public static function parseFromCdbXml(SimpleXMLElement $xmlElement)
 {
     if (empty($xmlElement->categories)) {
         throw new CultureFeed_Cdb_ParseException('Categories missing for actor element');
     }
     if (empty($xmlElement->actordetails)) {
         throw new CultureFeed_Cdb_ParseException('Actordetails missing for actor element');
     }
     $actor = new self();
     $actor_attributes = $xmlElement->attributes();
     if (isset($actor_attributes['cdbid'])) {
         $actor->setCdbId((string) $actor_attributes['cdbid']);
     }
     if (isset($actor_attributes['externalid'])) {
         $actor->setExternalId((string) $actor_attributes['externalid']);
     }
     if (isset($actor_attributes['availablefrom'])) {
         $actor->setAvailableFrom((string) $actor_attributes['availablefrom']);
     }
     if (isset($actor_attributes['availableto'])) {
         $actor->setAvailableTo((string) $actor_attributes['availableto']);
     }
     if (isset($actor_attributes['createdby'])) {
         $actor->setCreatedBy((string) $actor_attributes['createdby']);
     }
     if (isset($actor_attributes['creationdate'])) {
         $actor->setCreationDate((string) $actor_attributes['creationdate']);
     }
     if (isset($actor_attributes['lastupdated'])) {
         $actor->setLastUpdated((string) $actor_attributes['lastupdated']);
     }
     if (isset($actor_attributes['lastupdatedby'])) {
         $actor->setLastUpdatedBy((string) $actor_attributes['lastupdatedby']);
     }
     if (isset($actor_attributes['owner'])) {
         $actor->setOwner((string) $actor_attributes['owner']);
     }
     $actor->setDetails(CultureFeed_Cdb_Data_ActorDetailList::parseFromCdbXml($xmlElement->actordetails));
     // Set categories
     $actor->setCategories(CultureFeed_Cdb_Data_CategoryList::parseFromCdbXml($xmlElement->categories));
     // Set contact information.
     if (!empty($xmlElement->contactinfo)) {
         $actor->setContactInfo(CultureFeed_Cdb_Data_ContactInfo::parseFromCdbXml($xmlElement->contactinfo));
     }
     // Set the keywords.
     self::parseKeywords($xmlElement, $actor);
     // Set the weekscheme.
     if (!empty($xmlElement->weekscheme)) {
         $actor->setWeekScheme(CultureFeed_Cdb_Data_Calendar_Weekscheme::parseFromCdbXml($xmlElement->weekscheme));
     }
     return $actor;
 }
Example #3
0
 /**
  * @see CultureFeed_Cdb_IElement::parseFromCdbXml(SimpleXMLElement $xmlElement)
  * @return CultureFeed_Cdb_List_Item
  */
 public static function parseFromCdbXml(SimpleXMLElement $xmlElement)
 {
     $attributes = $xmlElement->attributes();
     $item = new self();
     // Set ID.
     $item->setCdbId((string) $attributes['cidn']);
     if (!empty($attributes['private'])) {
         $item->setPrivate((bool) $attributes['private']);
     }
     if (!empty($attributes['externalid'])) {
         $item->setExternalId((string) $attributes['externalid']);
     }
     $item->setTitle((string) $attributes['title']);
     if (!empty($attributes['shortdescription'])) {
         $item->setShortDescription((string) $attributes['shortdescription']);
     }
     if (!empty($attributes['thumbnail'])) {
         $item->setThumbnail((string) $attributes['thumbnail']);
     }
     if (!empty($attributes['address'])) {
         $item->setAddress((string) $attributes['address']);
     }
     if (!empty($attributes['city'])) {
         $item->setCity((string) $attributes['city']);
     }
     if (!empty($attributes['zip'])) {
         $item->setZip((string) $attributes['zip']);
     }
     if (!empty($attributes['latlng'])) {
         $item->setCoordinates((string) $attributes['latlng']);
     }
     if (!empty($attributes['location'])) {
         $item->setLocation((string) $attributes['location']);
     }
     if (!empty($attributes['locationid'])) {
         $item->setLocationId((string) $attributes['locationid']);
     }
     if (!empty($attributes['calendarsummary'])) {
         $item->setCalendarSummary((string) $attributes['calendarsummary']);
     }
     if (!empty($attributes['itemtype'])) {
         $item->setType((string) $attributes['itemtype']);
     }
     if (!empty($attributes['price'])) {
         $item->setPrice((string) $attributes['price']);
     }
     if (!empty($attributes['pricedescription'])) {
         $item->setPriceDescription((string) $attributes['pricedescription']);
     }
     if (!empty($attributes['agefrom'])) {
         $item->setAgeFrom((string) $attributes['agefrom']);
     }
     if (!empty($attributes['performers'])) {
         $item->setPerformers((string) $attributes['performers']);
     }
     return $item;
 }