本文整理汇总了PHP中PhabricatorDestructionEngine::getViewer方法的典型用法代码示例。如果您正苦于以下问题:PHP PhabricatorDestructionEngine::getViewer方法的具体用法?PHP PhabricatorDestructionEngine::getViewer怎么用?PHP PhabricatorDestructionEngine::getViewer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhabricatorDestructionEngine
的用法示例。
在下文中一共展示了PhabricatorDestructionEngine::getViewer方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: destroyObjectPermanently
public function destroyObjectPermanently(PhabricatorDestructionEngine $engine)
{
$interfaces = id(new AlmanacInterfaceQuery())->setViewer($engine->getViewer())->withNetworkPHIDs(array($this->getPHID()))->execute();
foreach ($interfaces as $interface) {
$engine->destroyObject($interface);
}
$this->delete();
}
示例2: destroyObjectPermanently
public function destroyObjectPermanently(PhabricatorDestructionEngine $engine)
{
$bindings = id(new AlmanacBindingQuery())->setViewer($engine->getViewer())->withInterfacePHIDs(array($this->getPHID()))->execute();
foreach ($bindings as $binding) {
$engine->destroyObject($binding);
}
$this->delete();
}
示例3: destroyObjectPermanently
public function destroyObjectPermanently(PhabricatorDestructionEngine $engine)
{
$file_phid = $this->getFilePHID();
$file = id(new PhabricatorFileQuery())->setViewer($engine->getViewer())->withPHIDs(array($file_phid))->executeOne();
if ($file) {
$engine->destroyObject($file);
}
$this->delete();
}
示例4: destroyObjectPermanently
public function destroyObjectPermanently(PhabricatorDestructionEngine $engine)
{
$viewer = $engine->getViewer();
$this->openTransaction();
$packages = id(new PhabricatorPackagesPackageQuery())->setViewer($viewer)->withPublisherPHIDs(array($this->getPHID()))->execute();
foreach ($packages as $package) {
$engine->destroyObject($package);
}
$this->delete();
$this->saveTransaction();
}
示例5: destroyObjectPermanently
public function destroyObjectPermanently(PhabricatorDestructionEngine $engine)
{
$this->openTransaction();
$this->delete();
$books = id(new DivinerBookQuery())->setViewer($engine->getViewer())->withRepositoryPHIDs(array($this->getPHID()))->execute();
foreach ($books as $book) {
$engine->destroyObject($book);
}
$atoms = id(new DivinerAtomQuery())->setViewer($engine->getViewer())->withRepositoryPHIDs(array($this->getPHID()))->execute();
foreach ($atoms as $atom) {
$engine->destroyObject($atom);
}
$this->saveTransaction();
}
示例6: destroyObjectPermanently
public function destroyObjectPermanently(PhabricatorDestructionEngine $engine)
{
$this->openTransaction();
$posts = id(new PhamePostQuery())->setViewer($engine->getViewer())->withBlogPHIDs(array($this->getPHID()))->execute();
foreach ($posts as $post) {
$engine->destroyObject($post);
}
$this->delete();
$this->saveTransaction();
}
示例7: destroyObjectPermanently
public function destroyObjectPermanently(PhabricatorDestructionEngine $engine)
{
$this->openTransaction();
$diffs = id(new DifferentialDiffQuery())->setViewer($engine->getViewer())->withRevisionIDs(array($this->getID()))->execute();
foreach ($diffs as $diff) {
$engine->destroyObject($diff);
}
$conn_w = $this->establishConnection('w');
queryfx($conn_w, 'DELETE FROM %T WHERE revisionID = %d', self::TABLE_COMMIT, $this->getID());
// we have to do paths a little differentally as they do not have
// an id or phid column for delete() to act on
$dummy_path = new DifferentialAffectedPath();
queryfx($conn_w, 'DELETE FROM %T WHERE revisionID = %d', $dummy_path->getTableName(), $this->getID());
$this->delete();
$this->saveTransaction();
}
示例8: destroyObjectPermanently
public function destroyObjectPermanently(PhabricatorDestructionEngine $engine)
{
$phid = $this->getPHID();
$this->openTransaction();
$this->delete();
PhabricatorRepositoryURIIndex::updateRepositoryURIs($phid, array());
$books = id(new DivinerBookQuery())->setViewer($engine->getViewer())->withRepositoryPHIDs(array($phid))->execute();
foreach ($books as $book) {
$engine->destroyObject($book);
}
$atoms = id(new DivinerAtomQuery())->setViewer($engine->getViewer())->withRepositoryPHIDs(array($phid))->execute();
foreach ($atoms as $atom) {
$engine->destroyObject($atom);
}
$lfs_refs = id(new PhabricatorRepositoryGitLFSRefQuery())->setViewer($engine->getViewer())->withRepositoryPHIDs(array($phid))->execute();
foreach ($lfs_refs as $ref) {
$engine->destroyObject($ref);
}
$this->saveTransaction();
}
示例9: destroyObjectPermanently
public function destroyObjectPermanently(PhabricatorDestructionEngine $engine)
{
$awards = id(new PhabricatorBadgesAwardQuery())->setViewer($engine->getViewer())->withBadgePHIDs(array($this->getPHID()))->execute();
foreach ($awards as $award) {
$engine->destroyObject($award);
}
$this->openTransaction();
$this->delete();
$this->saveTransaction();
}
示例10: destroyObjectPermanently
public function destroyObjectPermanently(PhabricatorDestructionEngine $engine)
{
$this->openTransaction();
$this->delete();
$externals = id(new PhabricatorExternalAccount())->loadAllWhere('userPHID = %s', $this->getPHID());
foreach ($externals as $external) {
$external->delete();
}
$prefs = id(new PhabricatorUserPreferencesQuery())->setViewer($engine->getViewer())->withUsers(array($this))->execute();
foreach ($prefs as $pref) {
$engine->destroyObject($pref);
}
$profiles = id(new PhabricatorUserProfile())->loadAllWhere('userPHID = %s', $this->getPHID());
foreach ($profiles as $profile) {
$profile->delete();
}
$keys = id(new PhabricatorAuthSSHKeyQuery())->setViewer($engine->getViewer())->withObjectPHIDs(array($this->getPHID()))->execute();
foreach ($keys as $key) {
$engine->destroyObject($key);
}
$emails = id(new PhabricatorUserEmail())->loadAllWhere('userPHID = %s', $this->getPHID());
foreach ($emails as $email) {
$email->delete();
}
$sessions = id(new PhabricatorAuthSession())->loadAllWhere('userPHID = %s', $this->getPHID());
foreach ($sessions as $session) {
$session->delete();
}
$factors = id(new PhabricatorAuthFactorConfig())->loadAllWhere('userPHID = %s', $this->getPHID());
foreach ($factors as $factor) {
$factor->delete();
}
$this->saveTransaction();
}
示例11: destroyTransform
private function destroyTransform(PhabricatorTransformedFile $xform)
{
$engine = new PhabricatorDestructionEngine();
$file = id(new PhabricatorFileQuery())->setViewer($engine->getViewer())->withPHIDs(array($xform->getTransformedPHID()))->executeOne();
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
if (!$file) {
if ($xform->getID()) {
$xform->delete();
}
} else {
$engine->destroyObject($file);
}
unset($unguarded);
}
示例12: destroyObjectPermanently
public function destroyObjectPermanently(PhabricatorDestructionEngine $engine)
{
$viewer = $engine->getViewer();
$this->openTransaction();
$trigger_phid = $this->getTriggerPHID();
if ($trigger_phid) {
$trigger = id(new PhabricatorWorkerTriggerQuery())->setViewer($viewer)->withPHIDs(array($trigger_phid))->executeOne();
if ($trigger) {
$engine->destroyObject($trigger);
}
}
$events = id(new PhabricatorCalendarEventQuery())->setViewer($viewer)->withImportSourcePHIDs(array($this->getPHID()))->execute();
foreach ($events as $event) {
$engine->destroyObject($event);
}
$logs = id(new PhabricatorCalendarImportLogQuery())->setViewer($viewer)->withImportPHIDs(array($this->getPHID()))->execute();
foreach ($logs as $log) {
$engine->destroyObject($log);
}
$this->delete();
$this->saveTransaction();
}
示例13: destroyObjectPermanently
public function destroyObjectPermanently(PhabricatorDestructionEngine $engine)
{
$viewer = $engine->getViewer();
$this->delete();
}