Esempio n. 1
0
 public function create(Chapter $_chapter, \string $name)
 {
     $this->_chapter = $_chapter;
     $this->chapter_id = $_chapter->getId();
     $this->name = $name;
     $this->_pdo->perform("INSERT INTO pledge_class (chapter_id, `name`) VALUES (:cid, :n)", ["cid" => $_chapter->getId(), "n" => $name]);
     $this->id = $this->_pdo->lastInsertId();
 }
Esempio n. 2
0
 public function sendSignUpNotificationEmail(Chapter $_chapter)
 {
     $this->send(self::$T_SIGN_UP_NOTIFICATION, Config::getDevUser($this->_pdo), ["CHAPTER_ID" => $_chapter->getId(), "NAME" => $_chapter->getGreekOrganization()->getName(), "LETTERS" => $_chapter->getGreekOrganization()->getLetters(), "UNIVERSITY" => $_chapter->getUniversity()->getName()]);
 }
Esempio n. 3
0
 /**
  * @param BasePDO $_pdo
  * @param Chapter $_c
  * @return User[]
  */
 public static function findAllActiveAssociatesForChapter(BasePDO $_pdo, Chapter $_c) : array
 {
     $query = "SELECT * FROM `user` WHERE chapter_id = :c AND is_active = 1 AND is_brother = 0";
     return $_pdo->fetchAssoc($query, ["c" => $_c->getId()], function ($row) use($_pdo, $_c) {
         $tmp = new self($_pdo, $row);
         $tmp->_chapter = $_c;
         return $tmp;
     });
 }
Esempio n. 4
0
 /**
  * @param BasePDO $_pdo
  * @param Chapter $_chapter
  * @return self[]
  */
 public static function findAllForChapter(BasePDO $_pdo, Chapter $_chapter) : array
 {
     $query = "SELECT e.* FROM `event` e LEFT JOIN `user` u ON u.id = e.creator_id WHERE u.chapter_id = :cid";
     return $_pdo->fetchAll($query, ["cid" => $_chapter->getId()], function ($row) use($_pdo, $_chapter) {
         $row = new self($_pdo, $row);
         $row->_group = $_chapter;
         return $row;
     });
 }
Esempio n. 5
0
 public function queueSignUpNotificationEmail(Chapter $_chapter)
 {
     $this->send(self::A_CHAPTER_ANNOUNCEMENT_EMAIL, ["chapter_id" => $_chapter->getId()]);
 }
Esempio n. 6
0
 /**
  * @param BasePDO $_pdo
  * @param Chapter $_chapter
  * @return Swag[]
  */
 public static function findAllForChapter(BasePDO $_pdo, Chapter $_chapter) : array
 {
     $query = "SELECT s.* FROM chapter c\n\t\t\t\t\t\tRIGHT JOIN `user` u ON u.chapter_id = c.id\n\t\t\t\t\t\tRIGHT JOIN swag s ON s.creator_id = u.id\n\t\t\t\t\t  WHERE c.id = :cid";
     return $_pdo->fetchAssoc($query, ["cid" => $_chapter->getId()], function (array $row) use($_pdo) {
         return new self($_pdo, $row);
     });
 }