Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcMichalsky committed Sep 6, 2023
1 parent 5c489b5 commit fc0a33c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions CRM/Twingle/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function getAttribute($attribute_name, $default = NULL) {
* @param string $attribute_name
* @param mixed $value
*
* @throws \Exception
* @throws \CRM\Twingle\Exceptions\ProfileException
* When the attribute name is not known.
*/
public function setAttribute($attribute_name, $value) {
Expand Down Expand Up @@ -221,7 +221,8 @@ public function getTransactionID($twingle_id) {
* Verifies whether the profile is valid (i.e. consistent and not colliding
* with other profiles).
*
* @throws Exception
* @throws \CRM\Twingle\Exceptions\ProfileValidationError
* @throws \Civi\Core\Exception\DBQueryException
* When the profile could not be successfully validated.
*/
public function verifyProfile() {
Expand All @@ -231,7 +232,9 @@ public function verifyProfile() {
}

/**
* Persists the profile within the CiviCRM settings.
* Persists the profile within the database.
*
* @throws \CRM\Twingle\Exceptions\ProfileException
*/
public function saveProfile() {
// make sure it's valid
Expand Down Expand Up @@ -269,7 +272,7 @@ public function saveProfile() {
/**
* Deletes the profile from the database
*
* @throws \CRM_Twingle_Exceptions_ProfileException
* @throws \CRM\Twingle\Exceptions\ProfileException
*/
public function deleteProfile() {
// Do only reset default profile
Expand Down Expand Up @@ -447,6 +450,7 @@ public static function createDefaultProfile($name = 'default') {
* @param $project_id
*
* @return CRM_Twingle_Profile
* @throws \Civi\Core\Exception\DBQueryException
*/
public static function getProfileForProject($project_id) {
$profiles = self::getProfiles();
Expand All @@ -468,6 +472,7 @@ public static function getProfileForProject($project_id) {
*
* @return CRM_Twingle_Profile | NULL
* @throws \Civi\Core\Exception\DBQueryException
* @throws \CRM\Twingle\Exceptions\ProfileException
*/
public static function getProfile(int $id = NULL) {
if (!empty($id)) {
Expand Down

0 comments on commit fc0a33c

Please sign in to comment.