Differential D16196 Diff 38966 src/applications/search/relationship/PhabricatorObjectRelationship.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/search/relationship/PhabricatorObjectRelationship.php
<?php | <?php | ||||
abstract class PhabricatorObjectRelationship extends Phobject { | abstract class PhabricatorObjectRelationship extends Phobject { | ||||
private $viewer; | private $viewer; | ||||
private $contentSource; | |||||
public function setViewer(PhabricatorUser $viewer) { | public function setViewer(PhabricatorUser $viewer) { | ||||
$this->viewer = $viewer; | $this->viewer = $viewer; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getViewer() { | public function getViewer() { | ||||
return $this->viewer; | return $this->viewer; | ||||
} | } | ||||
public function setContentSource(PhabricatorContentSource $content_source) { | |||||
$this->contentSource = $content_source; | |||||
return $this; | |||||
} | |||||
public function getContentSource() { | |||||
return $this->contentSource; | |||||
} | |||||
final public function getRelationshipConstant() { | final public function getRelationshipConstant() { | ||||
return $this->getPhobjectClassConstant('RELATIONSHIPKEY'); | return $this->getPhobjectClassConstant('RELATIONSHIPKEY'); | ||||
} | } | ||||
abstract public function isEnabledForObject($object); | abstract public function isEnabledForObject($object); | ||||
abstract public function getEdgeConstant(); | abstract public function getEdgeConstant(); | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | abstract class PhabricatorObjectRelationship extends Phobject { | ||||
} | } | ||||
private function getActionURI($object) { | private function getActionURI($object) { | ||||
$phid = $object->getPHID(); | $phid = $object->getPHID(); | ||||
$type = $this->getRelationshipConstant(); | $type = $this->getRelationshipConstant(); | ||||
return "/search/rel/{$type}/{$phid}/"; | return "/search/rel/{$type}/{$phid}/"; | ||||
} | } | ||||
public function canUndoRelationship() { | |||||
return true; | |||||
} | |||||
public function willUpdateRelationships($object, array $add, array $rem) { | |||||
return array(); | |||||
} | |||||
public function didUpdateRelationships($object, array $add, array $rem) { | |||||
return; | |||||
} | |||||
} | } |