35 public static function Unlink ($parentNodeId, $childNodeId);
60 public static function SetProperty ($parentNodeId, $childNodeId, $propertyName, $value);
74 public static function GetProperty ($parentNodeId, $childNodeId, $propertyName);
152 private static $arNodesCache =
array();
153 private static $nodesCached = 0;
158 return (self::_ListImmediateNeighbours ($nodeId, self::NBRS_IMDT_PARENTS));
163 return (self::_ListImmediateNeighbours ($nodeId, self::NBRS_IMDT_CHILDS));
168 return (self::_ListImmediateNeighbours ($nodeId, self::NBRS_IMDT_PARENTS | self::NBRS_IMDT_CHILDS));
178 if ($bitmaskSearchMode & self::NBRS_IMDT_PARENTS)
179 $arWhere[] =
"TARGET_NODE='" . (int) ($nodeId + 0) .
"'";
182 if ($bitmaskSearchMode & self::NBRS_IMDT_CHILDS)
183 $arWhere[] =
"SOURCE_NODE='" . (int) ($nodeId + 0) .
"'";
186 $sqlWhere = implode (
' OR ', $arWhere);
190 throw new LearnException (
'EA_PARAMS: nothing to search (check search mode bitmask);',
194 if ( ! array_key_exists($sqlWhere, self::$arNodesCache) )
198 "SELECT SOURCE_NODE, TARGET_NODE, SORT
199 FROM b_learn_lesson_edges
201 $ignore_errors =
true);
209 while ($arData = $rc->Fetch())
212 'SOURCE_NODE' => $arData[
'SOURCE_NODE'],
213 'TARGET_NODE' => $arData[
'TARGET_NODE'],
214 'PARENT_LESSON' => $arData[
'SOURCE_NODE'],
215 'CHILD_LESSON' => $arData[
'TARGET_NODE'],
216 'SORT' => (
int) $arData[
'SORT']
221 if (self::$nodesCached < 1024)
223 ++self::$nodesCached;
224 self::$arNodesCache[$sqlWhere] =
$result;
228 $result = self::$arNodesCache[$sqlWhere];
239 self::$arNodesCache =
array();
240 self::$nodesCached = 0;
244 && ($parentNodeId > 0)
245 && ($childNodeId > 0);
259 'EA_PARAMS: ' . $parentNodeId .
' / ' . $childNodeId .
' / ' . var_export(
$arProperties,
true),
273 "INSERT INTO b_learn_lesson_edges (SOURCE_NODE, TARGET_NODE, SORT)
274 VALUES ('" . $parentNodeId .
"', '" . $childNodeId .
"', '" . $sort .
"')",
275 $ignore_errors =
true);
281 public static function Unlink ($parentNodeId, $childNodeId)
286 self::$arNodesCache =
array();
287 self::$nodesCached = 0;
289 $args_check = ($parentNodeId > 0) && ($childNodeId > 0);
299 "DELETE FROM b_learn_lesson_edges
300 WHERE SOURCE_NODE = '" . $parentNodeId .
"'
301 AND TARGET_NODE = '" . $childNodeId .
"'",
302 $ignore_errors =
true);
307 if ($rc->AffectedRowsCount() == 0)
311 public static function SetProperty ($parentNodeId, $childNodeId, $propertyName, $value)
316 self::$arNodesCache =
array();
317 self::$nodesCached = 0;
319 $args_check = ($parentNodeId > 0) && ($childNodeId > 0)
320 && ( in_array ($propertyName,
array(
'SORT'),
true) );
322 if ($propertyName ===
'SORT')
325 $args_check = $args_check && is_numeric ($value) && is_int ($value + 0);
334 switch ($propertyName)
337 $value = (int) ($value + 0);
350 "WHERE SOURCE_NODE='" . $parentNodeId .
"'
351 AND TARGET_NODE='" . $childNodeId .
"'", __LINE__,
false,
370 public static function GetProperty ($parentNodeId, $childNodeId, $propertyName)
374 $args_check = ($parentNodeId > 0) && ($childNodeId > 0)
375 && ( in_array ($propertyName,
array(
'SORT'),
true) );
384 switch ($propertyName)
398 "SELECT " . $field .
"
399 FROM b_learn_lesson_edges
400 WHERE SOURCE_NODE='" . $parentNodeId .
"'
401 AND TARGET_NODE='" . $childNodeId .
"'",
402 $ignore_errors =
true);
407 if ( ! (($arData = $rc->Fetch()) && isset($arData[$field])) )
411 switch ($propertyName)
414 $rc = (int) $arData[$field];
static GetProperty($parentNodeId, $childNodeId, $propertyName)
static SetProperty($parentNodeId, $childNodeId, $propertyName, $value)
static Link($parentNodeId, $childNodeId, $arProperties)
static ListImmediateNeighbours($nodeId)
static Unlink($parentNodeId, $childNodeId)
static ListImmediateChilds($nodeId)
static ListImmediateParents($nodeId)
static _ListImmediateNeighbours($nodeId, $bitmaskSearchMode)
const EXC_ERR_GR_SET_PROPERTY
const EXC_ERR_GR_GET_NEIGHBOURS
const EXC_ERR_GR_GET_PROPERTY
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
static GetProperty($parentNodeId, $childNodeId, $propertyName)
static SetProperty($parentNodeId, $childNodeId, $propertyName, $value)
static Link($parentNodeId, $childNodeId, $arProperties)
static ListImmediateNeighbours($nodeId)
static Unlink($parentNodeId, $childNodeId)
static ListImmediateChilds($nodeId)
static ListImmediateParents($nodeId)
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
if( $site[ 'SERVER_NAME']==='') if($site['SERVER_NAME']==='') $arProperties