Example #1
0
 public function getChapter() : Chapter
 {
     if (!$this->_chapter) {
         $this->_chapter = Chapter::find($this->_pdo, $this->chapter_id);
     }
     return $this->_chapter;
 }
Example #2
0
     }
     $chapter = \FMA\Organization\Chapter::find($_pdo, $cid);
     if (is_null($chapter)) {
         return ["err" => true, "msg" => "No chapter by that id."];
     }
     if ($chapter->getGreekOrganizationId() != $org->getId()) {
         return ["err" => true, "msg" => "Organization has no chapter by that id."];
     }
     return \FMA\User\User::findAllForChapterAsArray($_pdo, $chapter);
 });
 $router->map("GET", "/organization/[i:id]/chapter/[i:cid]/user/[i:uid]/", function ($id, $cid, $uid) use($_pdo) {
     $org = \FMA\Organization\GreekOrganization::find($_pdo, $id);
     if (is_null($org)) {
         return ["err" => true, "msg" => "No organization by that id."];
     }
     $chapter = \FMA\Organization\Chapter::find($_pdo, $cid);
     if (is_null($chapter)) {
         return ["err" => true, "msg" => "No chapter by that id."];
     }
     if ($chapter->getGreekOrganizationId() != $org->getId()) {
         return ["err" => true, "msg" => "Organization has no chapter by that id."];
     }
     $user = \FMA\User\User::find($_pdo, $uid);
     if (is_null($user)) {
         return ["err" => true, "msg" => "No user by that id."];
     }
     if ($user->getChapterId() != $chapter->getId()) {
         return ["err" => true, "msg" => "Chapter has no user by that id."];
     }
     return $user->toArray();
 });
Example #3
0
 private function sendSignUpNotificationEmail(\int $chapter_id)
 {
     $_chapter = Chapter::find($this->_pdo, $chapter_id);
     $this->_mailer->sendSignUpNotificationEmail($_chapter);
 }