本文整理汇总了PHP中OCA\Files_External\Lib\StorageConfig::getType方法的典型用法代码示例。如果您正苦于以下问题:PHP StorageConfig::getType方法的具体用法?PHP StorageConfig::getType怎么用?PHP StorageConfig::getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OCA\Files_External\Lib\StorageConfig
的用法示例。
在下文中一共展示了StorageConfig::getType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: manipulateStorageConfig
public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null)
{
if ($storage->getType() === StorageConfig::MOUNT_TYPE_ADMIN) {
$uid = '';
} else {
$uid = $user->getUID();
}
$credentials = $this->credentialsManager->retrieve($uid, self::CREDENTIALS_IDENTIFIER);
if (is_array($credentials)) {
$storage->setBackendOption('user', $credentials['user']);
$storage->setBackendOption('password', $credentials['password']);
}
}
示例2: manipulateStorageConfig
public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null)
{
if ($storage->getType() === StorageConfig::MOUNT_TYPE_ADMIN) {
$uid = '';
} elseif (is_null($user)) {
throw new InsufficientDataForMeaningfulAnswerException('No credentials saved');
} else {
$uid = $user->getUID();
}
$credentials = $this->credentialsManager->retrieve($uid, self::CREDENTIALS_IDENTIFIER);
if (is_array($credentials)) {
$storage->setBackendOption('user', $credentials['user']);
$storage->setBackendOption('password', $credentials['password']);
}
}
示例3: isApplicable
protected function isApplicable(StorageConfig $config)
{
return $config->getApplicableUsers() === [$this->getUser()->getUID()] && $config->getType() === StorageConfig::MOUNT_TYPE_PERSONAl;
}