Differential D13429 Diff 32808 src/applications/passphrase/credentialtype/PassphraseCredentialType.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/passphrase/credentialtype/PassphraseCredentialType.php
Show All 10 Lines | abstract class PassphraseCredentialType extends Phobject { | ||||
abstract public function getCredentialTypeDescription(); | abstract public function getCredentialTypeDescription(); | ||||
abstract public function getSecretLabel(); | abstract public function getSecretLabel(); | ||||
public function newSecretControl() { | public function newSecretControl() { | ||||
return new AphrontFormTextAreaControl(); | return new AphrontFormTextAreaControl(); | ||||
} | } | ||||
public static function getAllTypes() { | public static function getAllTypes() { | ||||
$types = id(new PhutilSymbolLoader()) | return id(new PhutilClassMapQuery()) | ||||
->setAncestorClass(__CLASS__) | ->setAncestorClass(__CLASS__) | ||||
->loadObjects(); | ->setUniqueMethod('getCredentialType') | ||||
return $types; | ->execute(); | ||||
} | } | ||||
public static function getAllCreateableTypes() { | public static function getAllCreateableTypes() { | ||||
$types = self::getAllTypes(); | $types = self::getAllTypes(); | ||||
foreach ($types as $key => $type) { | foreach ($types as $key => $type) { | ||||
if (!$type->isCreateable()) { | if (!$type->isCreateable()) { | ||||
unset($types[$key]); | unset($types[$key]); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines |