46 if (isset($this->elementLinkProperties[
$entity]))
48 if (!is_object($this->elementLinkProperties[
$entity]))
49 $this->elementLinkProperties[
$entity] = Element::getInstance($this->elementLinkProperties[
$entity]);
50 return $this->elementLinkProperties[
$entity];
54 if (!is_object($this->sectionLinkProperties[
$entity]))
55 $this->sectionLinkProperties[
$entity] = Element::getInstance($this->sectionLinkProperties[
$entity]);
56 return $this->sectionLinkProperties[
$entity];
59 return parent::resolve(
$entity);
73 is_array($this->fields)
74 && $this->iblockId > 0
79 "select" =>
array(
"*"),
80 "filter" =>
array(
"=IBLOCK_ID" => $this->iblockId),
82 while ($row = $propertyList->fetch())
84 if ($row[
"USER_TYPE_SETTINGS"])
86 $row[
"USER_TYPE_SETTINGS"] = unserialize(
87 $row[
"USER_TYPE_SETTINGS"],
88 array(
'allowed_classes' =>
false)
93 if ($row[
"CODE"] !=
"")
97 foreach (
$fields as $propertyCode => $propertyValues)
99 if (is_array($propertyValues))
108 unset($propertyValues[
$i]);
116 $fieldCode = mb_strtolower($propertyCode);
118 if ($property[
"PROPERTY_TYPE"] ===
"L")
120 if (is_numeric($propertyValues))
124 elseif (is_array($propertyValues))
135 $value = $propertyValues;
138 elseif ($property[
"PROPERTY_TYPE"] ===
"E")
140 if ($propertyValues instanceof
Element)
142 $this->elementLinkProperties[$fieldCode] = $propertyValues;
143 $value = $propertyValues->getField(
"name");
145 elseif (is_numeric($propertyValues))
147 $this->elementLinkProperties[$fieldCode] = $propertyValues;
150 elseif (is_array($propertyValues))
161 $value = $propertyValues;
164 elseif ($property[
"PROPERTY_TYPE"] ===
"G")
166 if ($propertyValues instanceof
Section)
168 $this->sectionLinkProperties[$fieldCode] = $propertyValues;
169 $value = $propertyValues->getField(
"name");
171 elseif (is_numeric($propertyValues))
173 $this->sectionLinkProperties[$fieldCode] = $propertyValues;
176 elseif (is_array($propertyValues))
187 $value = $propertyValues;
192 if($property[
"USER_TYPE"] <>
'')
194 if(is_array($propertyValues))
209 $value = $propertyValues;
213 $this->fieldMap[$fieldCode] = $property[
"ID"];
214 $this->fieldMap[$property[
"ID"]] = $property[
"ID"];
215 if ($property[
"CODE"] !=
"")
216 $this->fieldMap[mb_strtolower($property[
"CODE"])] = $property[
"ID"];
218 $this->fields[$property[
"ID"]] = $value;
232 if (!isset($this->fields) && $this->iblockId > 0)
234 $this->fields =
array();
235 $this->fieldMap =
array();
236 $propertyList = \CIBlockElement::getProperty(
239 array(
"sort" =>
"asc"),
240 array(
"EMPTY" =>
"N")
242 while ($property = $propertyList->fetch())
244 if ($property[
"VALUE_ENUM"] !=
"")
246 $value = $property[
"VALUE_ENUM"];
248 elseif ($property[
"PROPERTY_TYPE"] ===
"E")
250 $this->elementLinkProperties[$property[
"ID"]] = $property[
"VALUE"];
251 if ($property[
"CODE"] !=
"")
252 $this->elementLinkProperties[mb_strtolower($property[
"CODE"])] = $property[
"VALUE"];
255 elseif ($property[
"PROPERTY_TYPE"] ===
"G")
257 $this->sectionLinkProperties[$property[
"ID"]] = $property[
"VALUE"];
258 if ($property[
"CODE"] !=
"")
259 $this->sectionLinkProperties[mb_strtolower($property[
"CODE"])] = $property[
"VALUE"];
264 if($property[
"USER_TYPE"] <>
'')
270 $value = $property[
"VALUE"];
274 $this->fieldMap[$property[
"ID"]] = $property[
"ID"];
275 if ($property[
"CODE"] !=
"")
276 $this->fieldMap[mb_strtolower($property[
"CODE"])] = $property[
"ID"];
278 if ($property[
"MULTIPLE"] ==
"Y")
279 $this->fields[$property[
"ID"]][] = $value;
281 $this->fields[$property[
"ID"]] = $value;
284 return is_array($this->fields);