passman/lib/Service/CredentialService.php

35 lines
795 B
PHP
Raw Normal View History

2016-09-12 01:45:20 +08:00
<?php
/**
* Nextcloud - passman
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Sander Brand <brantje@gmail.com>
* @copyright Sander Brand 2016
*/
namespace OCA\Passman\Service;
use OCP\IConfig;
use OCP\AppFramework\Db\DoesNotExistException;
use OCA\Passman\Db\CredentialMapper;
class CredentialService {
private $credentialMapper;
public function __construct(CredentialMapper $credentialMapper) {
$this->credentialMapper = $credentialMapper;
}
public function createCredential($credential) {
return $this->credentialMapper->create($credential);
}
2016-09-12 02:47:29 +08:00
public function getCredentialsByVaultId($vault_id, $user_id){
return $this->credentialMapper->getCredentialsByVaultId($vault_id, $user_id);
}
2016-09-12 01:45:20 +08:00
}