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


PHP Store::getProperties方法代碼示例

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


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

示例1: dispatchUpdateForSubject

 /**
  * @since 1.9.0.1
  *
  * @param DIWikiPage $subject
  */
 protected function dispatchUpdateForSubject(DIWikiPage $subject)
 {
     Profiler::In(__METHOD__, true);
     $this->addUpdateJobsForProperties($this->store->getProperties($subject));
     $this->addUpdateJobsForProperties($this->store->getInProperties($subject));
     $this->addUpdateJobsFromSerializedData();
     Profiler::Out(__METHOD__, true);
     return $this;
 }
開發者ID:whysasse,項目名稱:kmwiki,代碼行數:14,代碼來源:UpdateDispatcherJob.php

示例2: beforeSave

 /**
 * Override modResourceUpdateProcessor::beforeSave to provide custom functionality, saving settings for the container
 * to a custom field in the DB.
 *
 * The Post data comes thru flattened (boo)
 *
        [specs_4] => on
        [specs_12] => on
        [taxonomies_3] => on
        [taxonomies_4] => on
        [variations_1] => Option Only
        [variations_2] => Variant
        [variations_3]
 * On the flip side, it should be available in JS via this path: MODx.activePage.config.record.properties.moxycart
 *
 * {@inheritDoc}
 * @return boolean
 */
 public function beforeSave()
 {
     $raw = $this->getProperties();
     // <-- this will have raw values
     $properties = $this->object->getProperties('moxycart');
     //<-- we need to update these values
     $this->object->set('class_key', 'Store');
     //$this->modx->log(1,'beforeSave raw values: '.print_r($raw,true));
     //$this->modx->log(1,'existing values: '.print_r($properties,true));
     //$this->modx->log(1,'beforeSave raw POST values: '.print_r($_POST,true));
     $properties['product_type'] = $this->modx->getOption('product_type', $raw);
     $properties['product_template'] = $this->modx->getOption('product_template', $raw);
     $properties['track_inventory'] = $this->modx->getOption('track_inventory', $raw) == 'Yes' ? 1 : 0;
     $properties['sort_order'] = $this->modx->getOption('sort_order', $raw);
     $properties['qty_alert'] = $this->modx->getOption('qty_alert', $raw);
     // Fresh start...
     $properties['specs'] = array();
     $properties['taxonomies'] = array();
     $properties['variations'] = array();
     foreach ($raw as $k => $v) {
         $len = strlen($k);
         if ($this->starts_with($k, 'specs')) {
             $properties['specs'][substr($k, 6 - $len)] = true;
         }
         if ($this->starts_with($k, 'taxonomies')) {
             $properties['taxonomies'][substr($k, 11 - $len)] = true;
         }
         if ($this->starts_with($k, 'variations')) {
             $properties['variations'][substr($k, 11 - $len)] = $v;
         }
     }
     $this->object->setProperties($properties, 'moxycart');
     return parent::beforeSave();
 }
開發者ID:carnevlu,項目名稱:repoman,代碼行數:52,代碼來源:store.class.php


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