示例#1
0
/**
 * Fetch tour_id for tour with specified idno or label
 *
 * @param string $ps_tour Tour code or tour label
 * @return int tour_id of tour or null if no matching tour was found
 */
function caGetTourID($ps_tour)
{
    $t_tour = new ca_tours();
    if (is_numeric($ps_tour)) {
        if ($t_tour->load((int) $ps_tour)) {
            return $t_tour->getPrimaryKey();
        }
    }
    if ($t_tour->load(array('tour_code' => $ps_tour))) {
        return $t_tour->getPrimaryKey();
    }
    $t_label = new ca_tour_labels();
    if ($t_label->load(array('name' => $ps_tour))) {
        return $t_label->get('tour_id');
    }
    return null;
}
示例#2
0
 /**
  * Returns list of items in specified set
  *
  * @param int $set_id
  * @param array $pa_options Optional array of options. Supported options are:
  *	thumbnailVersions = A list of of a media versions to return with each item. Only used if the set content type is ca_objects.
  *	thumbnailVersion = Same as 'thumbnailVersions' except it is a single value. (Maintained for compatibility with older code.)
  *	limit = Limits the total number of records to be returned
  *	checkAccess = An array of row-level access values to check set members for, often produced by the caGetUserAccessValues() helper. Set members with access values not in the list will be omitted. If this option is not set or left null no access checking is done.
  *	returnRowIdsOnly = If true a simple array of row_ids (keys of the set members) for members of the set is returned rather than full item-level info for each set member.
  *	returnItemIdsOnly = If true a simple array of item_ids (keys for the ca_set_items rows themselves) is returned rather than full item-level info for each set member.
  *	returnItemAttributes = A list of attribute element codes for the ca_set_item record to return values for.
  * @return array
  * @throws SoapFault
  */
 public function getTourStops($tour_id, $options)
 {
     $t_tour = new ca_tours();
     if (!$t_tour->load($tour_id)) {
         throw new SoapFault("Server", "Invalid tour_id");
     }
     return $t_tour->getStops();
 }