Ejemplo n.º 1
0
 /**
  * @param BasePDO $_pdo
  * @param FilesystemInterface $_fs
  * @param Event $_e
  * @return File[]
  */
 public static function findForEvent(BasePDO $_pdo, FilesystemInterface $_fs, Event $_e) : array
 {
     $query = "SELECT f.*\n\t\t\t\t\t  FROM `file` f RIGHT JOIN rel_file_event rfe ON f.id = rfe.file_id\n\t\t\t\t\t  WHERE rfe.event_id = :eid";
     return $_pdo->fetchAssoc($query, ["eid" => $_e->getId()], function ($row) use($_pdo, $_fs) {
         return new File($_pdo, $_fs, $row);
     });
 }
Ejemplo n.º 2
0
 /**
  * @param BasePDO $_pdo
  * @param string $search
  * @return self[]
  */
 public static function search(BasePDO $_pdo, \string $search) : array
 {
     $query = "SELECT * FROM greek_organization WHERE `name` LIKE :s";
     return $_pdo->fetchAssoc($query, ["s" => "%" . $_pdo->quote($search) . "%"], function ($row) use($_pdo) {
         return new self($_pdo, $row);
     });
 }
Ejemplo n.º 3
0
 /**
  * @param BasePDO $_pdo
  * @param GreekOrganization $_org
  * @return array[]
  */
 public static function findAllForGreekOrganizationAsArray(BasePDO $_pdo, GreekOrganization $_org) : array
 {
     return $_pdo->fetchAssoc("SELECT * FROM chapter WHERE greek_organization_id = :id", ["id" => $_org->getId()]);
 }
Ejemplo n.º 4
0
 /**
  * @param BasePDO $_pdo
  * @param int $big_id
  * @return User[]
  */
 public static function findAllWithBigBrother(BasePDO $_pdo, \int $big_id) : array
 {
     $query = "SELECT * FROM `user` WHERE big_brother_id = :bid";
     return $_pdo->fetchAssoc($query, ["bid" => $big_id], function ($row) use($_pdo) {
         return new self($_pdo, $row);
     });
 }
Ejemplo n.º 5
0
 /**
  * @param BasePDO $_pdo
  * @param User $_user
  * @return self[]
  */
 public static function findAllForUser(BasePDO $_pdo, User $_user) : array
 {
     return $_pdo->fetchAssoc("SELECT * FROM fee WHERE user_id = :u", ["u" => $_user->getId()], function ($row) use($_pdo) {
         return new self($_pdo, $row);
     });
 }
Ejemplo n.º 6
0
 /**
  * @param BasePDO $_pdo
  * @param Group $_group
  * @return self[]
  */
 public static function findAllForGroup(BasePDO $_pdo, Group $_group) : array
 {
     return $_pdo->fetchAssoc("SELECT * FROM `event` WHERE group_id = :id", ["id" => $_group->getId()], function ($row) use($_pdo, $_group) {
         $row = new self($_pdo, $row);
         $row->_group = $_group;
         return $row;
     });
 }
Ejemplo n.º 7
0
 /**
  * @param BasePDO $_pdo
  * @param User $_user
  * @return Swag[]
  */
 public static function findAllByCreator(BasePDO $_pdo, User $_user) : array
 {
     return $_pdo->fetchAssoc("SELECT * FROM swag WHERE creator_id = :uid", ["uid" => $_user->getId()], function (array $row) use($_pdo) {
         return new self($_pdo, $row);
     });
 }