Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/engine/PhabricatorBoardLayoutEngine.php
| Show First 20 Lines • Show All 311 Lines • ▼ Show 20 Lines | final class PhabricatorBoardLayoutEngine extends Phobject { | ||||
| private function loadColumns(array $boards) { | private function loadColumns(array $boards) { | ||||
| $viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
| $columns = id(new PhabricatorProjectColumnQuery()) | $columns = id(new PhabricatorProjectColumnQuery()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->withProjectPHIDs(array_keys($boards)) | ->withProjectPHIDs(array_keys($boards)) | ||||
| ->execute(); | ->execute(); | ||||
| $columns = msort($columns, 'getSequence'); | $columns = msort($columns, 'getOrderingKey'); | ||||
| $columns = mpull($columns, null, 'getPHID'); | $columns = mpull($columns, null, 'getPHID'); | ||||
| $need_children = array(); | $need_children = array(); | ||||
| foreach ($boards as $phid => $board) { | foreach ($boards as $phid => $board) { | ||||
| if ($board->getHasMilestones() || $board->getHasSubprojects()) { | if ($board->getHasMilestones() || $board->getHasSubprojects()) { | ||||
| $need_children[] = $phid; | $need_children[] = $phid; | ||||
| } | } | ||||
| } | } | ||||
| Show All 34 Lines | foreach ($boards as $board_phid => $board) { | ||||
| $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | ||||
| $new_column->save(); | $new_column->save(); | ||||
| unset($unguarded); | unset($unguarded); | ||||
| $board_columns[$new_column->getPHID()] = $new_column; | $board_columns[$new_column->getPHID()] = $new_column; | ||||
| } | } | ||||
| } | } | ||||
| $board_columns = msort($board_columns, 'getOrderingKey'); | |||||
| $columns[$board_phid] = $board_columns; | $columns[$board_phid] = $board_columns; | ||||
| } | } | ||||
| foreach ($columns as $board_phid => $board_columns) { | foreach ($columns as $board_phid => $board_columns) { | ||||
| foreach ($board_columns as $board_column) { | foreach ($board_columns as $board_column) { | ||||
| $column_phid = $board_column->getPHID(); | $column_phid = $board_column->getPHID(); | ||||
| $this->columnMap[$column_phid] = $board_column; | $this->columnMap[$column_phid] = $board_column; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 202 Lines • Show Last 20 Lines | |||||