本文整理汇总了PHP中CsviHelper::getDomainName方法的典型用法代码示例。如果您正苦于以下问题:PHP CsviHelper::getDomainName方法的具体用法?PHP CsviHelper::getDomainName怎么用?PHP CsviHelper::getDomainName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CsviHelper
的用法示例。
在下文中一共展示了CsviHelper::getDomainName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getStart
/**
* Property tables export
*
* Exports category details data to either csv, xml or HTML format
*
* @copyright
* @author RolandD
* @todo
* @see
* @access public
* @param
* @return void
* @since 3.4
*/
public function getStart()
{
// Get some basic data
$db = JFactory::getDbo();
$csvidb = new CsviDb();
$jinput = JFactory::getApplication()->input;
$csvilog = $jinput->get('csvilog', null, null);
$template = $jinput->get('template', null, null);
$exportclass = $jinput->get('export.class', null, null);
$export_fields = $jinput->get('export.fields', array(), 'array');
$this->_domainname = CsviHelper::getDomainName();
$classname = 'CsviCom_Ezrealty_Config';
if (class_exists($classname)) {
$config = new $classname();
}
// Build something fancy to only get the fieldnames the user wants
$userfields = array();
foreach ($export_fields as $column_id => $field) {
switch ($field->field_name) {
case 'id':
case 'alias':
case 'checked_out':
case 'checked_out_time':
case 'editor':
case 'ordering':
case 'published':
$userfields[] = $db->qn('e.' . $field->field_name);
break;
case 'category':
$userfields[] = $db->qn('c.name');
break;
case 'country':
$userfields[] = $db->qn('cn.name', 'country');
break;
case 'state':
$userfields[] = $db->qn('st.name', 'state');
break;
case 'city':
$userfields[] = $db->qn('loc.ezcity', 'city');
break;
case 'fname':
case 'file_title':
case 'file_description':
case 'file_ordering':
case 'picture_url':
case 'picture_url_thumb':
$userfields[] = $db->qn('e.id');
break;
case 'custom':
break;
default:
$userfields[] = $db->qn($field->field_name);
break;
}
}
// Build the query
$userfields = array_unique($userfields);
$query = $db->getQuery(true);
$query->select(implode(",\n", $userfields));
$query->from($db->qn('#__ezrealty', 'e'));
$query->leftJoin($db->qn('#__ezrealty_catg', 'c') . ' ON ' . $db->qn('e.cid') . ' = ' . $db->qn('c.id'));
$query->leftJoin($db->qn('#__ezrealty_country', 'cn') . ' ON ' . $db->qn('e.cnid') . ' = ' . $db->qn('cn.id'));
$query->leftJoin($db->qn('#__ezrealty_state', 'st') . ' ON ' . $db->qn('e.stid') . ' = ' . $db->qn('st.id'));
$query->leftJoin($db->qn('#__ezrealty_locality', 'loc') . ' ON ' . $db->qn('e.locid') . ' = ' . $db->qn('loc.id'));
$selectors = array();
// Filter by published state
$publish_state = $template->get('publish_state', 'general');
if ($publish_state != '' && ($publish_state == 1 || $publish_state == 0)) {
$selectors[] = $db->qn('e.published') . ' = ' . $publish_state;
}
// Filter by transaction type
$transaction_type = $template->get('transaction_type', 'property');
if ($transaction_type[0] != '') {
$selectors[] = $db->qn('e.type') . ' IN (' . implode(',', $transaction_type) . ')';
}
// Filter by property type
$property_type = $template->get('property_type', 'property');
if ($property_type[0] != '') {
$selectors[] = $db->qn('e.cid') . ' IN (' . implode(',', $property_type) . ')';
}
// Filter by street
$street = $template->get('street', 'property');
if ($street[0] != '') {
$selectors[] = $db->qn('e.address2') . " IN ('" . implode("','", $street) . "')";
}
// Filter by locality
//.........这里部分代码省略.........
示例2: getStart
/**
* Product export
*
* Exports product data to either csv, xml or HTML format
*
* @copyright
* @author RolandD
* @todo
* @see
* @access public
* @param
* @return void
* @since 3.0
*/
public function getStart()
{
// Get some basic data
$jinput = JFactory::getApplication()->input;
$db = JFactory::getDbo();
$csvidb = new CsviDb();
$jinput = JFactory::getApplication()->input;
$csvilog = $jinput->get('csvilog', null, null);
$template = $jinput->get('template', null, null);
$exportclass = $jinput->get('export.class', null, null);
$export_fields = $jinput->get('export.fields', array(), 'array');
$this->_domainname = CsviHelper::getDomainName();
$helper = new Com_VirtueMart();
$sef = new CsviSef();
// Build something fancy to only get the fieldnames the user wants
$userfields = array();
foreach ($export_fields as $column_id => $field) {
if ($field->process) {
switch ($field->field_name) {
case 'created_on':
case 'modified_on':
case 'locked_on':
case 'created_by':
case 'modified_by':
case 'locked_by':
case 'virtuemart_product_id':
case 'virtuemart_vendor_id':
case 'hits':
case 'metaauthor':
case 'metarobot':
case 'published':
$userfields[] = $db->quoteName('#__virtuemart_products') . '.' . $db->quoteName($field->field_name);
break;
case 'category_id':
case 'category_path':
$userfields[] = $db->quoteName('#__virtuemart_product_categories') . '.' . $db->quoteName('virtuemart_category_id');
$userfields[] = $db->quoteName('#__virtuemart_products') . '.' . $db->quoteName('virtuemart_product_id');
break;
case 'product_name':
case 'product_s_desc':
case 'product_desc':
case 'metadesc':
case 'metakey':
case 'slug':
case 'customtitle':
case 'custom_value':
case 'custom_price':
case 'custom_param':
case 'custom_title':
case 'file_url':
case 'file_url_thumb':
$userfields[] = $db->quoteName('#__virtuemart_products') . '.' . $db->quoteName('virtuemart_product_id');
break;
case 'product_parent_sku':
$userfields[] = $db->quoteName('#__virtuemart_products') . '.' . $db->quoteName('product_parent_id');
break;
case 'related_products':
$userfields[] = $db->quoteName('#__virtuemart_products') . '.' . $db->quoteName('virtuemart_product_id') . ' AS main_product_id';
break;
case 'product_box':
$userfields[] = $db->quoteName('#__virtuemart_products') . '.' . $db->quoteName('product_packaging');
break;
case 'product_price':
case 'price_with_tax':
$userfields[] = $db->quoteName('#__virtuemart_product_prices') . '.' . $db->quoteName('product_price');
$userfields[] = $db->quoteName('#__virtuemart_currencies') . '.' . $db->quoteName('currency_code_3');
break;
case 'product_url':
$userfields[] = $db->quoteName('#__virtuemart_products') . '.' . $db->quoteName('virtuemart_product_id');
$userfields[] = $db->quoteName('#__virtuemart_products') . '.' . $db->quoteName('product_url');
$userfields[] = $db->quoteName('#__virtuemart_products') . '.' . $db->quoteName('product_parent_id');
break;
case 'price_with_discount':
$userfields[] = $db->quoteName('#__virtuemart_product_prices') . '.' . $db->quoteName('product_price');
$userfields[] = $db->quoteName('#__virtuemart_currencies') . '.' . $db->quoteName('currency_code_3');
//$userfields[] = $db->quoteName('#__virtuemart_calcs').'.'.$db->quoteName('calc_value');
//$userfields[] = $db->quoteName('#__virtuemart_calcs').'.'.$db->quoteName('calc_value_mathop');
//$userfields[] = $db->quoteName('#__virtuemart_calcs').'.'.$db->quoteName('calc_kind');
break;
case 'product_currency':
$userfields[] = $db->quoteName('#__virtuemart_currencies') . '.' . $db->quoteName('currency_code_3');
break;
case 'custom_shipping':
$userfields[] = $db->quoteName('#__virtuemart_product_prices') . '.' . $db->quoteName('product_price');
$userfields[] = '1 AS tax_rate';
break;
//.........这里部分代码省略.........
示例3: __construct
/**
* Constructor
*
* @copyright
* @author RolandD
* @todo
* @see
* @access public
* @param
* @return
* @since 4.0
*/
public function __construct()
{
$this->_domainname = CsviHelper::getDomainName();
}