コード例 #1
0
 public function searchMembers($memberSearchParameters, $dbConnection = null)
 {
     $membersList = null;
     $preparedStatement = null;
     try {
         $memberSearchQuery = null;
         $memberIDQuery = null;
         if ($dbConnection == null) {
             $dbConnection = DatabaseUtilities::getDatabaseConnection();
         }
         $memberIDQuery = "SELECT DISTINCT M.MEMBER_ID FROM member M WHERE 1 = 1";
         $memberIDQuery .= MemberSearchDao::getMemberSearchWhereClause($memberSearchParameters);
         $memberSearchQuery = MemberSearchDao::MEMBER_SEARCH_SELECT;
         $memberSearchQuery .= " AND M.MEMBER_ID IN (" . $memberIDQuery . ")\n\t\t\t\t\t\t\t\t\t\t\t\tORDER BY M.LAST_NAME ASC, M.FIRST_NAME ASC\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT :pagingAmount OFFSET :startingPoint";
         $preparedStatement = MemberSearchDao::getMemberSearchPreparedStatement($memberSearchQuery, $memberSearchParameters, $dbConnection);
         MemberSearchDao::addPagingParameters($preparedStatement, $memberSearchParameters);
         $preparedStatement->execute();
         while ($result = $preparedStatement->fetch()) {
             $member = MemberSearchDao::extractMemberSearchObject($result, true);
             if ($member !== null) {
                 $member->setVariable(Member::MEMBER_INSTRUMENTS, MemberInstrumentDao::selectMemberInstruments($member->getVariable(Member::MEMBER_ID), true, $dbConnection));
                 $membersList[] = $member;
             }
         }
         $preparedStatement = null;
     } catch (Exception $ex) {
         echo $ex->getMessage();
         $membersList = null;
     }
     $preparedStatement = null;
     return $membersList;
 }
コード例 #2
0
 public function getMemberInstruments($memberID, $skeleton, $dbConnection)
 {
     $memberInstruments = null;
     try {
         $memberInstruments = MemberInstrumentDao::selectMemberInstruments($memberID, $skeleton, $dbConnection);
     } catch (Exception $ex) {
         $memberInstruments = null;
     }
     return $memberInstruments;
 }