Differential D20659 Diff 49281 src/applications/auth/xaction/PhabricatorAuthConfigPropertyTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/xaction/PhabricatorAuthConfigPropertyTransaction.php
- This file was added.
<?php | |||||
final class PhabricatorAuthConfigPropertyTransaction | |||||
extends PhabricatorAuthConfigTransactionType { | |||||
const TRANSACTIONTYPE = 'config:property'; | |||||
public function generateOldValue($object) { | |||||
$key = $this->getMetadataValue( | |||||
PhabricatorAuthProviderConfigTransaction::PROPERTY_KEY); | |||||
return $object->getProperty($key); | |||||
} | |||||
public function applyInternalEffects($object, $value) { | |||||
$key = $this->getMetadataValue( | |||||
PhabricatorAuthProviderConfigTransaction::PROPERTY_KEY); | |||||
$object->setProperty($key, $value); | |||||
} | |||||
public function getTitle() { | |||||
$provider = $this->getObject()->getProvider(); | |||||
if ($provider) { | |||||
$legacy_xaction = $this->getLegacyUnderlyingTransactionObject(); | |||||
$title = $provider->renderConfigPropertyTransactionTitle($legacy_xaction); | |||||
if (strlen($title)) { | |||||
return $title; | |||||
} | |||||
} | |||||
return pht( | |||||
'%s edited a property of this provider.', | |||||
$this->renderAuthor()); | |||||
} | |||||
} |