本文整理汇总了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;
}
示例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();
}