本文整理汇总了PHP中BFCHelper::getMerchantFromServicebyId方法的典型用法代码示例。如果您正苦于以下问题:PHP BFCHelper::getMerchantFromServicebyId方法的具体用法?PHP BFCHelper::getMerchantFromServicebyId怎么用?PHP BFCHelper::getMerchantFromServicebyId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BFCHelper
的用法示例。
在下文中一共展示了BFCHelper::getMerchantFromServicebyId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getResourceFromService
public function getResourceFromService()
{
$params = $this->getState('params');
$resourceId = $params['resourceId'];
$resourceIdRef = $params['resourceId'];
$options = array('path' => sprintf($this->urlResource, $resourceId), 'data' => array('$format' => 'json'));
$url = $this->helper->getQuery($options);
$cultureCode = JFactory::getLanguage()->getTag();
$resource = null;
$r = $this->helper->executeQuery($url);
if (isset($r)) {
$res = json_decode($r);
//$resource = $res->d->results ?: $res->d;
if (!empty($res->d->results)) {
$resource = $res->d->results;
} elseif (!empty($res->d)) {
$resource = $res->d;
}
$resource->Merchant = BFCHelper::getMerchantFromServicebyId($resource->MerchantId);
// $resource->Services = $resource->OnSellUnit->Services;
if (!empty($resource->ServiceIdList)) {
$services = BFCHelper::GetServicesByIds($resource->ServiceIdList, $cultureCode);
$resource->Services = $services;
if (count($resource->Services) > 0) {
$tmpservices = array();
foreach ($resource->Services as $service) {
$tmpservices[] = $service->Name;
}
// $services = implode(', ',$tmpservices);
}
$resource->Services = $services;
}
}
return $resource;
}
示例2: defined
<?php
/**
* @package Bookingforconnector
* @copyright Copyright (c)2006-2016 Ipertrade
* @license GNU General Public License version 3, or later
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$resource = $this->item;
$language = $this->language;
$resource->Merchant = BFCHelper::getMerchantFromServicebyId($resource->MerchantId);
$merchant = $resource->Merchant;
$config = $this->config;
$XGooglePosDef = $config->get('posx', 0);
$YGooglePosDef = $config->get('posy', 0);
$startzoom = $config->get('startzoom', 14);
$googlemapsapykey = $config->get('googlemapskey', '');
if (!empty($resource)) {
//$merchant = $resource->Merchant;
//$resourceName = BFCHelper::getLanguage($resource->Name, $this->language);
$resourceName = BFCHelper::getLanguage($resource->Name, $this->language, null, array('ln2br' => 'ln2br', 'striptags' => 'striptags'));
$resourceDescription = BFCHelper::getLanguage($resource->Description, $this->language, null, array('ln2br' => 'ln2br', 'striptags' => 'striptags'));
//$typeName = BFCHelper::getLanguage($resource->CategoryName, $this->language);
//$zone = $resource->LocationZone;
//$location = $resource->LocationName;
//
/*---------------IMPOSTAZIONI SEO----------------------*/
// $this->document->setTitle($titleHead);
// $this->document->setMetadata('og:title', $titleHead);
// $this->document->setDescription($descriptionHead);
示例3: array
$listlocationZones[] = JHTML::_('select.option', $lz);
}
}
}
$listsId = array();
$resourceImageUrl = Juri::root() . "components/com_bookingforconnector/assets/images/defaults/default-s6.jpeg";
$merchantLogoUrl = Juri::root() . "components/com_bookingforconnector/assets/images/defaults/default-s1.jpeg";
$resourceLogoPath = BFCHelper::getImageUrlResized('onsellunits', "[img]", 'medium');
$resourceLogoPathError = BFCHelper::getImageUrl('onsellunits', "[img]", 'medium');
$merchantImageUrl = Juri::root() . "components/com_bookingforconnector/assets/images/defaults/default-s6.jpeg";
$merchantLogoUrl = Juri::root() . "components/com_bookingforconnector/assets/images/defaults/default-s6.jpeg";
$merchantLogoPath = BFCHelper::getImageUrlResized('merchant', "[img]", 'logomedium');
$merchantLogoPathError = BFCHelper::getImageUrl('merchant', "[img]", 'logomedium');
$merchantId = $this->params['merchantId'];
if (isset($merchantId) && $merchantId > 0) {
$merchant = BFCHelper::getMerchantFromServicebyId($merchantId);
$route = JRoute::_('index.php?option=com_bookingforconnector&view=merchantdetails&merchantId=' . $merchant->MerchantId . ':' . BFCHelper::getSlug($resource->MerchantName));
?>
<h3 class="mod_bookingforconnector_merchantdetails-menuTitle"><a href="<?php
echo $route;
?>
" class="item"><span class="fn org"><?php
echo "";
?>
</span></a></h3>
<?php
}
//-------------------pagina per i l redirect di tutte le risorse in vendita
$db = JFactory::getDBO();
$uri = 'index.php?option=com_bookingforconnector&view=onsellunit';
$db->setQuery('SELECT id FROM #__menu WHERE link LIKE ' . $db->Quote($uri) . ' AND (language=' . $db->Quote($language) . ' OR language=' . $db->Quote('*') . ') AND published = 1 LIMIT 1');
示例4: getResourceFromService
public function getResourceFromService()
{
$params = $this->getState('params');
$resourceId = $params['resourceId'];
$resourceIdRef = $params['resourceId'];
// if (empty($language)){
$language = JFactory::getLanguage()->getTag();
// }
$options = array('path' => $this->urlResource, 'data' => array('$format' => 'json', 'id' => $resourceId, 'cultureCode' => BFCHelper::getQuotedString($language)));
$url = $this->helper->getQuery($options);
$resource = null;
$r = $this->helper->executeQuery($url);
if (isset($r)) {
$res = json_decode($r);
//$resource = $res->d->results ?: $res->d;
if (!empty($res->d->results)) {
$resource = $res->d->results;
} elseif (!empty($res->d)) {
$resource = $res->d;
}
}
// if (!isset($resource)) {
// $options = array(
// 'path' => sprintf($this->urlUnit, $resourceId),
// 'data' => array(
// '$format' => 'json',
// '$filter' => 'Enabled eq true' /* Tags eq \'extra\' and */,
// '$expand' => 'Typology'
// )
// );
// $url = $this->helper->getQuery($options);
// $r = $this->helper->executeQuery($url);
// $unit = null;
//
// if (isset($r)) { // se non trovo la risorsa cerco l'unit\E0 figlia
// $res = json_decode($r);
//// $unit = $res->d->results ?: $res->d;
// if (!empty($res->d->results)){
// $unit = $res->d->results;
// }elseif(!empty($res->d)){
// $unit = $res->d;
// }
// $resourceIdRef = $unit->Typology->RefUnit;
// $options = array(
// 'path' => sprintf($this->urlResource, $resourceIdRef),
// 'data' => array(
// '$format' => 'json',
// '$expand' => 'Merchant'
// )
// );
// $url = $this->helper->getQuery($options);
// $r = $this->helper->executeQuery($url);
// if (isset($r)) {
// $res = json_decode($r);
//// $resource = $res->d->results ?: $res->d;
// if (!empty($res->d->results)){
// $resource = $res->d->results;
// }elseif(!empty($res->d)){
// $resource = $res->d;
// }
// }
// if (isset($resource)) {
// $resource->ReferenceName = $resource->Name;
// $resource->Name = $unit->Name;
// $resource->ImageUrl = $unit->ImageUrl;
// $resource->ImageData = $unit->ImageData;
// $resource->XAltGooglePos = $unit->XAltGooglePos;
// $resource->YAltGooglePos = $unit->YAltGooglePos;
// //$resource->Description = $unit->Description;
// $resource->IsReference = false;
// $resource->TypeRef = $resource->TypeRef;
// }
//
//
// }
//
// }else{
// $resource->ReferenceName = $resource->Name;
// $resource->IsReference = true;
// }
// $resource->Description = $this->getDescription($resource->ResourceId);
// $params['hasRateplans'] = $resource->HasRateplans;
// // riassegno i parametri recuperati
// $this->setState('params', $params);
//
// //if (!BFCHelper::isRatePlanStay()) { // vecchio metodo...
// if(!$resource->HasRateplans){
// $resource->Extras = $this->getExtrasFromService();
// $resource->PriceTypes = $this->getPriceTypesFromService();
// $resource->MerchantBookingTypes = $this->getMerchantBookingTypesFromService();
// }
$resource->Merchant = BFCHelper::getMerchantFromServicebyId($resource->MerchantId);
return $resource;
}