passman/lib/Service/CredentialRevisionService.php

48 lines
1.4 KiB
PHP
Raw Normal View History

2016-09-24 17:40:15 +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;
2016-10-05 20:30:28 +08:00
use OCA\Passman\Db\CredentialRevision;
2016-09-24 17:40:15 +08:00
use OCP\IConfig;
use OCP\AppFramework\Db\DoesNotExistException;
use OCA\Passman\Db\CredentialRevisionMapper;
class CredentialRevisionService {
private $credentialRevisionMapper;
public function __construct(CredentialRevisionMapper $credentialRevisionMapper) {
$this->credentialRevisionMapper = $credentialRevisionMapper;
}
2016-10-04 03:36:39 +08:00
public function createRevision($credential, $userId, $credential_id, $edited_by) {
return $this->credentialRevisionMapper->create($credential, $userId, $credential_id, $edited_by);
2016-09-24 17:40:15 +08:00
}
public function getRevisions($credential_id, $user_id = null){
2016-09-24 17:40:15 +08:00
return $this->credentialRevisionMapper->getRevisions($credential_id, $user_id);
}
2016-09-24 18:59:19 +08:00
2016-10-05 20:30:28 +08:00
public function getRevision($credential_id, $user_id = null){
return $this->credentialRevisionMapper->getRevision($credential_id, $user_id);
}
2016-09-24 18:59:19 +08:00
public function deleteRevision($revision_id, $user_id){
return $this->credentialRevisionMapper->deleteRevision($revision_id, $user_id);
}
2016-10-05 20:30:28 +08:00
public function updateRevision(CredentialRevision $credentialRevision){
return $this->credentialRevisionMapper->update($credentialRevision);
}
2016-09-24 17:40:15 +08:00
}