Differential D20681 Diff 49334 src/applications/project/storage/PhabricatorProjectColumnPosition.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/storage/PhabricatorProjectColumnPosition.php
| Show All 40 Lines | public function attachColumn(PhabricatorProjectColumn $column) { | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function setViewSequence($view_sequence) { | public function setViewSequence($view_sequence) { | ||||
| $this->viewSequence = $view_sequence; | $this->viewSequence = $view_sequence; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function getOrderingKey() { | public function newColumnPositionOrderVector() { | ||||
| // We're ordering both real positions and "virtual" positions which we have | // We're ordering both real positions and "virtual" positions which we have | ||||
| // created but not saved yet. | // created but not saved yet. | ||||
| // Low sequence numbers go above high sequence numbers. Virtual positions | // Low sequence numbers go above high sequence numbers. Virtual positions | ||||
| // will have sequence number 0. | // will have sequence number 0. | ||||
| // High virtual sequence numbers go above low virtual sequence numbers. | // High virtual sequence numbers go above low virtual sequence numbers. | ||||
| // The layout engine gets objects in ID order, and this puts them in | // The layout engine gets objects in ID order, and this puts them in | ||||
| // reverse ID order. | // reverse ID order. | ||||
| // High IDs go above low IDs. | // High IDs go above low IDs. | ||||
| // Broadly, this collectively makes newly added stuff float to the top. | // Broadly, this collectively makes newly added stuff float to the top. | ||||
| return sprintf( | return id(new PhutilSortVector()) | ||||
| '~%012d%012d%012d', | ->addInt($this->getSequence()) | ||||
| $this->getSequence(), | ->addInt(-1 * $this->viewSequence) | ||||
| ((1 << 31) - $this->viewSequence), | ->addInt(-1 * $this->getID()); | ||||
| ((1 << 31) - $this->getID())); | |||||
| } | } | ||||
| /* -( PhabricatorPolicyInterface )----------------------------------------- */ | /* -( PhabricatorPolicyInterface )----------------------------------------- */ | ||||
| public function getCapabilities() { | public function getCapabilities() { | ||||
| return array( | return array( | ||||
| PhabricatorPolicyCapability::CAN_VIEW, | PhabricatorPolicyCapability::CAN_VIEW, | ||||
| ); | ); | ||||
| Show All 14 Lines | |||||