Esempio n. 1
0
 private function getDbFoldingMap($type, $scope = ENTITY_SCOPE_ALL)
 {
     if (!is_array($this->DB_FOLDING_MAP[$scope])) {
         $this->DB_FOLDING_MAP[$scope] = array('T' => array(), 'V' => array());
         /* @var $folding FoldedResources */
         foreach (FoldingsStore::inst()->getFoldings($scope) as $folding) {
             if ($folding->isWorkWithTable()) {
                 $T = $folding->getTableName();
                 $V = $folding->getTableView();
                 $this->DB_FOLDING_MAP[$scope]['T'][$T][] = $folding;
                 if ($T != $V) {
                     $this->DB_FOLDING_MAP[$scope]['V'][$V][] = $folding;
                 }
             }
         }
         if ($this->LOGGER->isEnabled()) {
             foreach (array('T' => 'Карта зависимости таблиц:', 'V' => 'Карта зависимости представлений:') as $itype => $title) {
                 $this->LOGGER->info();
                 $this->LOGGER->info("[{$scope}] [{$itype}] {$title}");
                 foreach ($this->DB_FOLDING_MAP[$scope][$itype] as $table => $foldings) {
                     $this->LOGGER->info("\t{$table}:");
                     foreach ($foldings as $folding) {
                         $this->LOGGER->info("\t\t" . $folding->getUnique());
                     }
                 }
             }
         }
     }
     return array_get_value($type, $this->DB_FOLDING_MAP[$scope]);
 }
Esempio n. 2
0
 /**
  * Проверка - входит ли фолдинг в SDK.
  * Важно! В конструкторе такую проверку делать нельзя, так как экземпляр фолдингов создаётся в хранилище фолдингов,
  * которое уже и знает, к чему относится фолдинг - к проекту или к SDK.
  * 
  * @return bool
  */
 public final function isSdk()
 {
     return $this->IS_SDK === null ? $this->IS_SDK = FoldingsStore::inst()->isSdkFolding($this) : $this->IS_SDK;
 }