當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CsviHelper::getDomainName方法代碼示例

本文整理匯總了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
//.........這裏部分代碼省略.........
開發者ID:alesconti,項目名稱:FF_2015,代碼行數:101,代碼來源:propertyexport.php

示例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;
//.........這裏部分代碼省略.........
開發者ID:srbsnkr,項目名稱:sellingonlinemadesimple,代碼行數:101,代碼來源:productexport.php

示例3: __construct

 /**
  * Constructor
  * 
  * @copyright 
  * @author 		RolandD
  * @todo 
  * @see 
  * @access 		public
  * @param 
  * @return 
  * @since 		4.0
  */
 public function __construct()
 {
     $this->_domainname = CsviHelper::getDomainName();
 }
開發者ID:spiridonov-oa,項目名稱:SheinCandles,代碼行數:16,代碼來源:csvisef.php


注:本文中的CsviHelper::getDomainName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。