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


PHP TiendaHelperBase::getColumn方法代碼示例

本文整理匯總了PHP中TiendaHelperBase::getColumn方法的典型用法代碼示例。如果您正苦於以下問題:PHP TiendaHelperBase::getColumn方法的具體用法?PHP TiendaHelperBase::getColumn怎麽用?PHP TiendaHelperBase::getColumn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TiendaHelperBase的用法示例。


在下文中一共展示了TiendaHelperBase::getColumn方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: deleteExpiredSessionProductCompared

 /**
  * 
  * Enter description here ...
  * @return unknown_type
  */
 public function deleteExpiredSessionProductCompared()
 {
     $db = JFactory::getDBO();
     Tienda::load('TiendaQuery', 'library.query');
     Tienda::load("TiendaHelperBase", 'helpers._base');
     $helper = new TiendaHelperBase();
     $query = new TiendaQuery();
     $query->select("tbl.session_id");
     $query->from("#__session AS tbl");
     $db->setQuery((string) $query);
     $results = $db->loadAssocList();
     $session_ids = $helper->getColumn($results, 'session_id');
     $query = new TiendaQuery();
     $query->delete();
     $query->from("#__tienda_productcompare");
     $query->where("`user_id` = '0'");
     $query->where("`session_id` NOT IN('" . implode("', '", $session_ids) . "')");
     $db->setQuery((string) $query);
     if (!$db->query()) {
         $this->setError($db->getErrorMsg());
         return false;
     }
     $date = JFactory::getDate();
     $now = $date->toMySQL();
     // Update config to say this has been done already
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tienda/tables');
     $config = JTable::getInstance('Config', 'TiendaTable');
     $config->load(array('config_name' => 'last_deleted_expired_sessionproductscompared'));
     $config->config_name = 'last_deleted_expired_sessionproductscompared';
     $config->value = $now;
     $config->save();
     return true;
 }
開發者ID:annggeel,項目名稱:tienda,代碼行數:38,代碼來源:productcompare.php

示例2: reconcileProductAttributeCSVs

 /**
  * Adds any necessary _productsquantities records
  *
  * @param unknown_type $product_id     Product ID
  * @param unknown_type $vendor_id      Vendor ID
  * @param array $items                 Array of productQuantities objects
  * @param unknown_type $csvs           CSV output from getProductAttributeCSVs
  * @return array $items                Array of objects
  */
 static function reconcileProductAttributeCSVs($product_id, $vendor_id, $items, $csvs)
 {
     // remove extras
     $done = array();
     foreach ($items as $key => $item) {
         if (!in_array($item->product_attributes, $csvs) || in_array($item->product_attributes, $done)) {
             $row = JTable::getInstance('ProductQuantities', 'TiendaTable');
             if (!$row->delete($item->productquantity_id)) {
                 JError::raiseNotice('1', $row->getError());
             }
             unset($items[$key]);
         }
         $done[] = $item->product_attributes;
     }
     // add new ones
     $existingEntries = TiendaHelperBase::getColumn($items, 'product_attributes');
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tienda/tables');
     foreach ($csvs as $csv) {
         if (!in_array($csv, $existingEntries)) {
             $row = JTable::getInstance('ProductQuantities', 'TiendaTable');
             $row->product_id = $product_id;
             $row->vendor_id = $vendor_id;
             $row->product_attributes = $csv;
             if (!$row->save()) {
                 JError::raiseNotice('1', $row->getError());
             }
             $items[] = $row;
         }
     }
     return $items;
 }
開發者ID:annggeel,項目名稱:tienda,代碼行數:40,代碼來源:product.php


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