Example #1
0
 public function getCredentialChangeRequest($id, User $currentUser)
 {
     $data = $this->conn->fetchAssoc('SELECT * FROM `' . CoreTables::CREDENTIAL_CHANGE_TBL . '` WHERE `id` = :id', [':id' => $id]);
     if (empty($data) || $data['userId'] != $currentUser->getId()) {
         throw new ModelException('The specified credential change request does not exist.');
     }
     return CredentialChangeRequest::fromArray($currentUser, $data);
 }