/** * Retrieve single accommodation feature value matching the $code filter * * @param string $code * @param array $params * @param Credentials $credentials API credentials * * @return self the retrieved accommodation feature value */ public static function singleFromXML($code, array $params = [], Credentials $credentials = null) { if (!empty($credentials)) { self::setCredentials($credentials); } $allowedParams = array('expand' => 1); $wrongParams = array_diff_key($params, $allowedParams); if (!empty($wrongParams)) { throw new \InvalidArgumentException('Invalid $params filter: ' . implode(', ', array_keys($wrongParams))); } $call = new XmlCall($credentials); $sxe = $call->execute('accommodation-feature-values/' . $code, 'GET', array_intersect_key($params, $allowedParams)); $ret = new self(); $ret->fromXML($sxe); return $ret; }
/** * Retrieve all article Langs matching the $params filter * * @param array $params filter parameters * @param Credentials $credentials API credentials * * @return $this */ public static function allFromXML(array $params = null, Credentials $credentials = null) { if (empty($params)) { $params = array(); } if (!empty($credentials)) { self::setCredentials($credentials); } $allowedParams = array('expand' => 1, 'language' => 1, 'page' => 1); $wrongParams = array_diff_key($params, $allowedParams); if (!empty($wrongParams)) { throw new \InvalidArgumentException('Invalid $params filter: ' . implode(', ', array_keys($wrongParams))); } $call = new XmlCall($credentials); $sxe = $call->execute('article-langs', 'GET', array_intersect_key($params, $allowedParams)); self::setTotalPageCount($call->getTotalPageCount()); $ret = new self(); $ret->fromXML($sxe); return $ret; }
/** * Retrieve all feature values matching the $params * * @param array $params * @param Credentials $credentials API credentials * * @return self the retrieved feature values */ public static function search(array $params = null, Credentials $credentials = null) { if (empty($params)) { $params = array(); } if (!empty($credentials)) { self::setCredentials($credentials); } $allowedParams = array('expand' => 1, 'language' => 1, 'page' => 1, 'id' => 1, 'code' => 1, 'feature_id' => 1, 'default_value' => 1, 'title' => 1, 'show_on_list' => 1); $wrongParams = array_diff_key($params, $allowedParams); if (!empty($wrongParams)) { throw new \InvalidArgumentException('Invalid $params filter: ' . implode(', ', array_keys($wrongParams))); } $call = new XmlCall($credentials); $sxe = $call->execute('feature-values/search', 'GET', array_intersect_key($params, $allowedParams)); self::setTotalPageCount($call->getTotalPageCount()); $ret = new self(); $ret->fromXML($sxe); return $ret; }
/** * Retrieve all locations matching the $params * * @param array $params * @param Credentials $credentials API credentials * * @return self the retrieved locations */ public static function search(array $params = null, Credentials $credentials = null) { if (empty($params)) { $params = array(); } if (!empty($credentials)) { self::setCredentials($credentials); } $allowedParams = array('expand' => 1, 'language' => 1, 'page' => 1, 'id' => 1, 'parent_id' => 1, 'population' => 1, 'map_zoom' => 1, 'altitude' => 1, 'created_at' => 1, 'updated_at' => 1, 'fields' => 1, 'country_code' => 1, 'country_codes' => 1, 'tel_code' => 1, 'tel_ambulance' => 1, 'tel_police' => 1, 'tel_road_aid' => 1, 'tel_emergency' => 1, 'tel_fire' => 1, 'special' => 1, 'status' => 1, 'type' => 1, 'name' => 1, 'created_type' => 1, 'status_for_dropdown' => 1, 'area_size' => 1, 'map_lat' => 1, 'map_lng' => 1); $wrongParams = array_diff_key($params, $allowedParams); if (!empty($wrongParams)) { throw new \InvalidArgumentException('Invalid $params filter: ' . implode(', ', array_keys($wrongParams))); } $call = new XmlCall($credentials); $sxe = $call->execute('locations/search', 'GET', array_intersect_key($params, $allowedParams)); self::setTotalPageCount($call->getTotalPageCount()); $ret = new self(); $ret->fromXML($sxe); return $ret; }
/** * Retrieve all actions matching the $params * * @param array $params * @param Credentials $credentials API credentials * * @return self the retrieved actions */ public static function search(array $params = null, Credentials $credentials = null) { if (empty($params)) { $params = array(); } if (!empty($credentials)) { self::setCredentials($credentials); } $allowedParams = array('expand' => 1, 'language' => 1, 'page' => 1, 'id' => 1, 'accommodation_unit_id' => 1, 'status' => 1, 'type' => 1, 'visible_from' => 1, 'visible_to' => 1, 'applicable_from' => 1, 'applicable_to' => 1); $wrongParams = array_diff_key($params, $allowedParams); if (!empty($wrongParams)) { throw new \InvalidArgumentException('Invalid $params filter: ' . implode(', ', array_keys($wrongParams))); } $call = new XmlCall($credentials); $sxe = $call->execute('actions/search', 'GET', array_intersect_key($params, $allowedParams)); self::setTotalPageCount($call->getTotalPageCount()); $ret = new self(); $ret->fromXML($sxe); return $ret; }
/** * Retrieve all charges matching the $params * * @param array $params * @param Credentials $credentials API credentials * * @return self the retrieved charges */ public static function search(array $params = null, Credentials $credentials = null) { if (empty($params)) { $params = array(); } if (!empty($credentials)) { self::setCredentials($credentials); } $allowedParams = array('expand' => 1, 'language' => 1, 'page' => 1, 'id' => 1, 'accommodation_category_id' => 1, 'title' => 1, 'display_mandatory' => 1, 'display_included' => 1, 'display_optional' => 1, 'display_per_night' => 1, 'display_per_week' => 1, 'display_once' => 1, 'display_per_person' => 1, 'display_per_unit' => 1); $wrongParams = array_diff_key($params, $allowedParams); if (!empty($wrongParams)) { throw new \InvalidArgumentException('Invalid $params filter: ' . implode(', ', array_keys($wrongParams))); } $call = new XmlCall($credentials); $sxe = $call->execute('charges/search', 'GET', array_intersect_key($params, $allowedParams)); self::setTotalPageCount($call->getTotalPageCount()); $ret = new self(); $ret->fromXML($sxe); return $ret; }
/** * Retrieve all discounts matching the $params * * @param array $params * @param Credentials $credentials API credentials * * @return self the retrieved discounts */ public static function search(array $params = null, Credentials $credentials = null) { if (empty($params)) { $params = array(); } if (!empty($credentials)) { self::setCredentials($credentials); } $allowedParams = array('expand' => 1, 'language' => 1, 'page' => 1, 'id' => 1, 'accommodation_category_id' => 1, 'title' => 1, 'allow_child_from_age' => 1, 'allow_child_to_age' => 1, 'allow_child_plus_adult' => 1, 'allow_child_on_bed_type' => 1, 'min_number_of_children' => 1, 'allow_stay_over_number_of_nights' => 1, 'allow_adult_on_extra_bed' => 1, 'allow_per_bed' => 1, 'allow_number_of_children_alone_in_room' => 1, 'allow_pay_nights_get_more' => 1, 'allow_apply_discount_on_last_child' => 1, 'allow_single_use' => 1); $wrongParams = array_diff_key($params, $allowedParams); if (!empty($wrongParams)) { throw new \InvalidArgumentException('Invalid $params filter: ' . implode(', ', array_keys($wrongParams))); } $call = new XmlCall($credentials); $sxe = $call->execute('discounts/search', 'GET', array_intersect_key($params, $allowedParams)); self::setTotalPageCount($call->getTotalPageCount()); $ret = new self(); $ret->fromXML($sxe); return $ret; }
/** * Retrieve all pricelists matching the $params * * @param array $params * @param Credentials $credentials API credentials * * @return self the retrieved pricelists */ public static function search(array $params = null, Credentials $credentials = null) { if (empty($params)) { $params = array(); } if (!empty($credentials)) { self::setCredentials($credentials); } $allowedParams = array('expand' => 1, 'language' => 1, 'page' => 1, 'id' => 1, 'accommodation_unit_id' => 1, 'created_at' => 1, 'updated_at' => 1, 'date_arrival' => 1, 'date_departure' => 1, 'nights_minimal' => 1, 'allowed_arrival_day' => 1, 'method' => 1, 'min_persons' => 1, 'max_persons' => 1, 'price' => 1); $wrongParams = array_diff_key($params, $allowedParams); if (!empty($wrongParams)) { throw new \InvalidArgumentException('Invalid $params filter: ' . implode(', ', array_keys($wrongParams))); } $call = new XmlCall($credentials); $sxe = $call->execute('pricelists/search', 'GET', array_intersect_key($params, $allowedParams)); self::setTotalPageCount($call->getTotalPageCount()); $ret = new self(); $ret->fromXML($sxe); return $ret; }