本文整理汇总了PHP中CSaleOrder::getLocationPropertyInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrder::getLocationPropertyInfo方法的具体用法?PHP CSaleOrder::getLocationPropertyInfo怎么用?PHP CSaleOrder::getLocationPropertyInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrder
的用法示例。
在下文中一共展示了CSaleOrder::getLocationPropertyInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseField
/**
* @param $key
*
* @return null|string
*/
public function parseField($key)
{
$output = null;
$locationPropInfo = \CSaleOrder::getLocationPropertyInfo();
$propIDTmp = false;
if (strpos($key, "PROPERTY_ID_") === 0) {
$propIDTmp = intval(substr($key, strlen("PROPERTY_ID_")));
$this->query->addFilter('=PROPERTY.ORDER_PROPS_ID', $propIDTmp);
if (isset($locationPropInfo['ID'][$propIDTmp])) {
$this->addQueryAlias('PROPERTY_ID_' . $propIDTmp, 'LOCATION.ID');
} else {
$this->addQueryAlias('PROPERTY_ID_' . $propIDTmp, 'PROPERTY.ID');
}
$output = 'PROPERTY_ID_' . $propIDTmp;
} elseif (strpos($key, "PROPERTY_ORDER_PROPS_ID_") === 0) {
$propIDTmp = intval(substr($key, strlen("PROPERTY_ORDER_PROPS_ID_")));
$this->query->addFilter('=PROPERTY.ORDER_PROPS_ID', $propIDTmp);
if (isset($locationPropInfo['ID'][$propIDTmp])) {
$this->addQueryAlias('PROPERTY_ORDER_PROPS_ID_' . $propIDTmp, 'LOCATION.ID');
} else {
$this->addQueryAlias('PROPERTY_ORDER_PROPS_ID_' . $propIDTmp, 'PROPERTY.ORDER_PROPS_ID');
}
$output = 'PROPERTY_ORDER_PROPS_ID_' . $propIDTmp;
} elseif (strpos($key, "PROPERTY_NAME_") === 0) {
$propIDTmp = intval(substr($key, strlen("PROPERTY_NAME_")));
$this->addQueryAlias('PROPERTY_NAME_' . $propIDTmp, 'PROPERTY.NAME');
$this->query->addFilter('=PROPERTY.ORDER_PROPS_ID', $propIDTmp);
$output = 'PROPERTY_NAME_' . $propIDTmp;
} elseif (strpos($key, "PROPERTY_VALUE_") === 0) {
$propIDTmp = intval(substr($key, strlen("PROPERTY_VALUE_")));
if (isset($locationPropInfo['ID'][$propIDTmp])) {
$this->addQueryAlias('PROPERTY_ID_' . $propIDTmp, 'LOCATION.ID');
} else {
$this->addQueryAlias('PROPERTY_ID_' . $propIDTmp, 'PROPERTY.VALUE');
}
$output = 'PROPERTY_ID_' . $propIDTmp;
} elseif (strpos($key, "PROPERTY_CODE_") === 0) {
$propIDTmp = intval(substr($key, strlen("PROPERTY_CODE_")));
$this->addQueryAlias('PROPERTY_CODE_' . $propIDTmp, 'PROPERTY.CODE');
$this->query->addFilter('=PROPERTY.ORDER_PROPS_ID', $propIDTmp);
$output = 'PROPERTY_CODE_' . $propIDTmp;
} elseif (strpos($key, "PROPERTY_VAL_BY_CODE_") === 0) {
$propIDTmp = preg_replace("/[^a-zA-Z0-9_-]/is", "", trim(substr($key, strlen("PROPERTY_VAL_BY_CODE_"))));
$this->addQueryAlias('PROPERTY_VAL_BY_CODE_' . $propIDTmp, 'PROPERTY.VALUE');
if (isset($locationPropInfo['CODE'][$propIDTmp])) {
$this->addQueryAlias('PROPERTY_VAL_BY_CODE_' . $propIDTmp, 'LOCATION.ID');
} else {
$this->addQueryAlias('PROPERTY_VAL_BY_CODE_' . $propIDTmp, 'PROPERTY.VALUE');
}
$this->query->addFilter('=PROPERTY.CODE', $propIDTmp);
$output = 'PROPERTY_VAL_BY_CODE_' . $propIDTmp;
}
if (isset($locationPropInfo['ID'][$propIDTmp])) {
$this->query->registerRuntimeField('LOCATION', array('data_type' => '\\Bitrix\\Sale\\Location\\LocationTable', 'reference' => array('=this.PROPERTY.VALUE' => 'ref.CODE'), 'join_type' => 'inner'));
}
return $output;
}