Skip to content

Commit

Permalink
Merge pull request #37 from bozzit/master
Browse files Browse the repository at this point in the history
Added A Function that Allows the Retreival of the GroupID By Name
  • Loading branch information
jbdabes authored Jul 26, 2017
2 parents 258d935 + 1919da0 commit 4ad489e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions include/Messaging.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,33 @@ public function GetAll()

return $data;
}

/**
* Get the GroupID (threadId) by the Group Name
*
* @param string $sGroupName Name of Group you are searching for within your Groups
* @throws
* @return string $sThreadId GroupID or null if not found
*/

public function GetGroupIdByName($sGroupName)
{
$oAllgroups = $this->GetAll();

$sThreadId = null;

foreach( $oAllgroups->threads as $iKey => $aGroupDetails)
{
if ($aGroupDetails->threadNameDetail->threadName == trim($sGroupName))
{
$sThreadId = $aGroupDetails->threadId;
break;
}

}
return $sThreadId;
}

// Get Favorite Groups
public function GetFavorites()
{
Expand Down

0 comments on commit 4ad489e

Please sign in to comment.