本文整理汇总了PHP中def_module::setEventPoint方法的典型用法代码示例。如果您正苦于以下问题:PHP def_module::setEventPoint方法的具体用法?PHP def_module::setEventPoint怎么用?PHP def_module::setEventPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类def_module
的用法示例。
在下文中一共展示了def_module::setEventPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeFromBasket
public function removeFromBasket($vdada7698e90003048a305e981875250f)
{
$v161c9aaa4fe035e7b2f465bc59f3ab45 = new umiEventPoint("eshop_remove_frombasket");
$v161c9aaa4fe035e7b2f465bc59f3ab45->setMode("before");
$v161c9aaa4fe035e7b2f465bc59f3ab45->setParam("element_id", $vdada7698e90003048a305e981875250f);
def_module::setEventPoint($v161c9aaa4fe035e7b2f465bc59f3ab45);
if ($this->oUserBasket instanceof umiObject) {
$v6a183de20981accc6e2669cd7c8e9f37 = $this->getBasketItem($vdada7698e90003048a305e981875250f);
if ($v6a183de20981accc6e2669cd7c8e9f37 instanceof umiObject) {
umiObjectsCollection::getInstance()->delObject($v6a183de20981accc6e2669cd7c8e9f37->getId());
$v6f6b8983aa8e35763123f65ae38eb0b2 = $this->oUserBasket->getValue('items');
if (is_array($v6f6b8983aa8e35763123f65ae38eb0b2)) {
$v6f6b8983aa8e35763123f65ae38eb0b2 = array_diff($v6f6b8983aa8e35763123f65ae38eb0b2, array($v6a183de20981accc6e2669cd7c8e9f37->getId()));
$this->oUserBasket->setValue('items', $v6f6b8983aa8e35763123f65ae38eb0b2);
}
$this->oUserBasket->commit();
$this->recalcBasket();
}
} elseif (isset($this->arrBasket[$vdada7698e90003048a305e981875250f])) {
unset($this->arrBasket[$vdada7698e90003048a305e981875250f]);
$this->recalcBasket();
}
}
示例2: saveFieldValue
//.........这里部分代码省略.........
}
if ($type == 'symlink') {
$value = $value;
}
if ($type == 'wysiwyg') {
$out = array();
if (preg_match_all("/href=[\"']?([^ ^\"^']+)[\"']?/i", $value, $out)) {
foreach ($out[1] as $link) {
$id = $hierarchy->getIdByPath($link);
if ($id) {
$link = str_replace("/", "\\/", $link);
$value = preg_replace("/(href=[\"']?)" . $link . "([\"']?)/i", "\\1%content get_page_url({$id})%\\2", $value);
}
}
}
} else {
$value = str_replace(array(' ', '&'), array(' ', '&'), $value);
}
if (in_array($type, array('text', 'string', 'int', 'float', 'price', 'date', 'tags', 'counter'))) {
$value = preg_replace("/<br ?\\/?>/i", "\n", $value);
$value = strip_tags($value);
}
if (in_array($type, array('img_file', 'swf_file', 'file', 'video_file')) && $value) {
if (substr($value, 0, 1) != '.') {
$value = '.' . $value;
}
}
$target->setValue($name, $value);
}
$target->commit();
umiObjectProperty::$IGNORE_FILTER_INPUT_STRING = false;
if ($target instanceof iUmiHierarchyElement) {
$backup = backupModel::getInstance();
$backup->fakeBackup($target->id);
}
$oEventPoint = new umiEventPoint("eipSave");
$oEventPoint->setMode("after");
$oEventPoint->setParam("field_name", $name);
$oEventPoint->setParam("obj", $target);
def_module::setEventPoint($oEventPoint);
}
if ($name == 'name') {
$value = $target->getName();
} else {
$value = $target->getValue($name, $optionParams);
}
if ($save) {
$value = xmlTranslator::executeMacroses($value);
}
if ($type == 'date') {
if ($value) {
$date = new umiDate();
$date->setDateByString($value);
$value = $date->getFormattedDate('Y-m-d H:i');
} else {
$value = '';
}
}
if ($type == 'tags' && is_array($value)) {
$value = implode(', ', $value);
}
if ($type == 'optioned' && !is_null($optionParams)) {
$value = isset($value[0]) ? $value[0] : '';
$type = getArrayKey($optionParams, 'field-type');
}
$result = array('attribute:name' => $name, 'attribute:type' => $type);
if ($type == 'relation') {
$items_arr = array();
if ($value) {
if (!is_array($value)) {
$value = array($value);
}
$objects = umiObjectsCollection::getInstance();
foreach ($value as $objectId) {
$object = $objects->getObject($objectId);
$items_arr[] = $object;
}
}
$result['attribute:guide-id'] = $field->getGuideId();
if ($field->getFieldType()->getIsMultiple()) {
$result['attribute:multiple'] = 'multiple';
}
$type = selector::get('object-type')->id($field->getGuideId());
if ($type && $type->getIsPublic()) {
$result['attribute:public'] = 'public';
}
$result['nodes:item'] = $items_arr;
} else {
if ($type == 'symlink') {
$result['nodes:page'] = is_array($value) ? $value : array();
} else {
$result['node:value'] = $value;
}
}
if ($oldLink != $newLink) {
$result['attribute:old-link'] = $oldLink;
$result['attribute:new-link'] = $newLink;
}
return $result;
}