Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $result = $query->execute();
- if (!empty($result['node'])) {
- $result = entity_load('node', array_keys($result['node']));
- }
- $items = array('data' => array(), 'tag' => 'Event');
- foreach ($result as $event) {
- $logo = NULL;
- if (isset($event->field_logo[LANGUAGE_NONE][0]['fid'])) {
- $logo = file_load($event->field_logo[LANGUAGE_NONE][0]['fid']);
- }
- $items['data'][] = array(
- 'data' => array(
- 'SiteId' => '', // @todo: replace with real value
- 'OriginatorKey' => '', // @todo: replace with real value
- 'State' => '', // @todo: replace with real value
- 'ResortId' => '', // @todo: replace with real value
- 'PlaceName' => '', // @todo: replace with real value
- 'Locality' => '', // @todo: replace with real value
- 'Street' => '', // @todo: replace with real value
- 'LangCode' => $lang,
- 'Title' => array(
- 'data' => $event->title_field[$lang][0]['value'],
- 'attributes' => array('language' => $lang),
- ),
- 'Description' => array(
- 'data' => '',
- 'attributes' => array('language' => $lang),
- ),
- 'AddInfo' => array(
- 'data' => $event->field_additional_information[$lang][0]['safe_value'],
- 'attributes' => array('language' => $lang),
- ),
- 'Category' => '', // @todo: replace with real value
- 'SubCategory' => '', // @todo: replace with real value
- 'PriceFrom' => $event->field_price_range[$lang][0]['min'],
- 'PriceTo' => $event->field_price_range[$lang][0]['max'],
- 'ReservationPossible' => '', // @todo: replace with real value
- 'ProspectusAvailable' => '', // @todo: replace with real value
- 'AddressInfo' => '', // @todo: replace with real value
- 'AddressAddInfo' => '', // @todo: replace with real value
- 'Phone' => '', // @todo: replace with real value
- 'Fax' => '', // @todo: replace with real value
- 'Url' => '', // @todo: replace with real value
- 'Email' => '', // @todo: replace with real value
- 'FreeField1' => '', // @todo: replace with real value
- 'FreeField2' => '', // @todo: replace with real value
- 'X' => '', // @todo: replace with real value
- 'Y' => '', // @todo: replace with real value
- 'Picture' => '', // @todo: replace with real value
- 'EveryYear' => '', // @todo: replace with real value
- 'Dates' => array(
- 'data' => array(
- 'DateFrom' => '',
- 'TimeFrom' => $event->field_time[$lang][0]['max'],
- 'TimeTo' => '',
- )
- ),
- 'Creator' => '', // @todo: replace with real value
- 'CreationDate' => date('d.m.Y H:m', $event->created)
- ),
- );
- }
- // return data.
- return $items;
- }
Add Comment
Please, Sign In to add comment