public function importIS_Padaliniai() { $sheetNr = 3; $isp = IS_PadaliniaiParseris::rastiIS_Padalinius($this->xlsData, $sheetNr); foreach ($isp as $i) { $linkTable = new LinkTable("IS_Padaliniai", "Padalinys", "IS"); $idPadalinys = Padaliniai::select("Kodas = '" . repairSqlInjection($i->kodas) . "'"); foreach ($i->naudojamosIS as $j) { $idIS = IS::select("Kodas = '" . repairSqlInjection($j) . "'"); if (sizeof($idPadalinys) > 0 && sizeof($idIS) > 0) { $linkTable->insert($idPadalinys[0], $idIS[0]); } } } }
static function buildRelationshipChain($ids, $categoryIds = null) { $chain = array(); foreach ($ids as $num => $id) { if ($num == 0) { $chain[$id] = array(); } else { $chain[$id] = LinkTable::getRelationshipIdsBetween($ids[$num - 1], $id, $categoryIds); } } return $chain; }