当前位置: 首页>>代码示例>>PHP>>正文


PHP CitruscartHelperBase::getColumn方法代码示例

本文整理汇总了PHP中CitruscartHelperBase::getColumn方法的典型用法代码示例。如果您正苦于以下问题:PHP CitruscartHelperBase::getColumn方法的具体用法?PHP CitruscartHelperBase::getColumn怎么用?PHP CitruscartHelperBase::getColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CitruscartHelperBase的用法示例。


在下文中一共展示了CitruscartHelperBase::getColumn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deleteExpiredSessionCarts

 /**
  *
  * Enter description here ...
  * @return unknown_type
  */
 public function deleteExpiredSessionCarts()
 {
     $db = JFactory::getDBO();
     Citruscart::load('CitruscartQuery', 'library.query');
     Citruscart::load("CitruscartHelperBase", 'helpers._base');
     $helper = new CitruscartHelperBase();
     $query = new CitruscartQuery();
     $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 CitruscartQuery();
     $query->delete();
     $query->from("#__citruscart_carts");
     $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->toSql();
     // Update config to say this has been done already
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_citruscart/tables');
     $config = JTable::getInstance('Config', 'CitruscartTable');
     $config->load(array('config_name' => 'last_deleted_expired_sessioncarts'));
     $config->config_name = 'last_deleted_expired_sessioncarts';
     $config->value = $now;
     $config->save();
     return true;
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:38,代码来源:carts.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', 'CitruscartTable');
             if (!$row->delete($item->productquantity_id)) {
                 JError::raiseNotice('1', $row->getError());
             }
             unset($items[$key]);
         }
         $done[] = $item->product_attributes;
     }
     // add new ones
     $existingEntries = CitruscartHelperBase::getColumn($items, 'product_attributes');
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_citruscart/tables');
     foreach ($csvs as $csv) {
         if (!in_array($csv, $existingEntries)) {
             $row = JTable::getInstance('ProductQuantities', 'CitruscartTable');
             $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:joomlacorner,项目名称:citruscart,代码行数:40,代码来源:product.php


注:本文中的CitruscartHelperBase::getColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。