Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/storage/PhabricatorRepositoryCommit.php
| Show First 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | public function hasAuditAuthority( | ||||
| if (!$actor_phid) { | if (!$actor_phid) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| return isset($map[$audit->getAuditorPHID()]); | return isset($map[$audit->getAuditorPHID()]); | ||||
| } | } | ||||
| public function writeOwnersEdges(array $package_phids) { | |||||
| $src_phid = $this->getPHID(); | |||||
| $edge_type = DiffusionCommitHasPackageEdgeType::EDGECONST; | |||||
| $editor = new PhabricatorEdgeEditor(); | |||||
| $dst_phids = PhabricatorEdgeQuery::loadDestinationPHIDs( | |||||
| $src_phid, | |||||
| $edge_type); | |||||
| foreach ($dst_phids as $dst_phid) { | |||||
| $editor->removeEdge($src_phid, $edge_type, $dst_phid); | |||||
| } | |||||
| foreach ($package_phids as $package_phid) { | |||||
| $editor->addEdge($src_phid, $edge_type, $package_phid); | |||||
| } | |||||
| $editor->save(); | |||||
| return $this; | |||||
| } | |||||
| public function getAuditorPHIDsForEdit() { | public function getAuditorPHIDsForEdit() { | ||||
| $audits = $this->getAudits(); | $audits = $this->getAudits(); | ||||
| return mpull($audits, 'getAuditorPHID'); | return mpull($audits, 'getAuditorPHID'); | ||||
| } | } | ||||
| public function save() { | public function save() { | ||||
| if (!$this->mailKey) { | if (!$this->mailKey) { | ||||
| $this->mailKey = Filesystem::readRandomCharacters(20); | $this->mailKey = Filesystem::readRandomCharacters(20); | ||||
| ▲ Show 20 Lines • Show All 418 Lines • Show Last 20 Lines | |||||