当前位置: 首页>>代码示例>>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;未经允许,请勿转载。