1 | <?php |
||
30 | class VaultMapper extends Mapper { |
||
31 | private $utils; |
||
32 | public function __construct(IDBConnection $db, Utils $utils) { |
||
33 | parent::__construct($db, 'passman_vaults'); |
||
34 | $this->utils = $utils; |
||
35 | } |
||
36 | |||
37 | |||
38 | /** |
||
39 | * @throws \OCP\AppFramework\Db\DoesNotExistException if not found |
||
40 | * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result |
||
41 | * @return Vault[] |
||
42 | */ |
||
43 | public function find($vault_id, $user_id) { |
||
44 | $sql = 'SELECT * FROM `*PREFIX*passman_vaults` ' . |
||
45 | 'WHERE `id`= ? and `user_id` = ?'; |
||
46 | return $this->findEntities($sql, [$vault_id, $user_id]); |
||
47 | } |
||
48 | /** |
||
49 | * @throws \OCP\AppFramework\Db\DoesNotExistException if not found |
||
50 | * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result |
||
51 | * @return Vault |
||
52 | */ |
||
53 | 1 | public function findByGuid($vault_guid, $user_id) { |
|
58 | |||
59 | |||
60 | /** |
||
61 | * @throws \OCP\AppFramework\Db\DoesNotExistException if not found |
||
62 | * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result |
||
63 | * @return Vault[] |
||
64 | */ |
||
65 | 1 | public function findVaultsFromUser($userId){ |
|
71 | |||
72 | /** |
||
73 | * Creates a vault |
||
74 | * @param $vault_name |
||
75 | * @param $userId |
||
76 | * @return Vault |
||
77 | */ |
||
78 | 1 | public function create($vault_name, $userId){ |
|
87 | |||
88 | /** |
||
89 | * Update last access time of a vault |
||
90 | * @param $vault_id |
||
91 | * @param $user_id |
||
92 | */ |
||
93 | 1 | public function setLastAccess($vault_id, $user_id){ |
|
100 | |||
101 | /** |
||
102 | * Update vault |
||
103 | * @param Vault $vault |
||
104 | */ |
||
105 | 1 | public function updateVault(Vault $vault){ |
|
108 | |||
109 | /** |
||
110 | * Update the sharing key's |
||
111 | * @param $vault_id |
||
112 | * @param $privateKey |
||
113 | * @param $publicKey |
||
114 | */ |
||
115 | 1 | public function updateSharingKeys($vault_id, $privateKey, $publicKey){ |
|
123 | } |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.