Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/storage/PhabricatorFile.php
Show First 20 Lines • Show All 1,421 Lines • ▼ Show 20 Lines | id(new PhabricatorEdgeEditor()) | ||||
->addEdge($phid, $edge_type, $this->getPHID()) | ->addEdge($phid, $edge_type, $this->getPHID()) | ||||
->save(); | ->save(); | ||||
return $this; | return $this; | ||||
} | } | ||||
/** | /** | ||||
* Remove the policy edge between this file and some object. | |||||
* | |||||
* @param phid Object PHID to detach from. | |||||
* @return this | |||||
*/ | |||||
public function detachFromObject($phid) { | |||||
$edge_type = PhabricatorObjectHasFileEdgeType::EDGECONST; | |||||
id(new PhabricatorEdgeEditor()) | |||||
->removeEdge($phid, $edge_type, $this->getPHID()) | |||||
->save(); | |||||
return $this; | |||||
} | |||||
/** | |||||
* Configure a newly created file object according to specified parameters. | * Configure a newly created file object according to specified parameters. | ||||
* | * | ||||
* This method is called both when creating a file from fresh data, and | * This method is called both when creating a file from fresh data, and | ||||
* when creating a new file which reuses existing storage. | * when creating a new file which reuses existing storage. | ||||
* | * | ||||
* @param map<string, wild> Bag of parameters, see @{class:PhabricatorFile} | * @param map<string, wild> Bag of parameters, see @{class:PhabricatorFile} | ||||
* for documentation. | * for documentation. | ||||
* @return this | * @return this | ||||
▲ Show 20 Lines • Show All 313 Lines • Show Last 20 Lines |