Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Array ( [2] => SELECT ed_donor_id FROM tbl_eligibility_dates WHERE ed_eligibility_date <= CURRENT_DATE AND ed_donor_id = [user_id] )
- public function meetsCriteria($userObj) {
- $criteriaQueryArr = $this->_getCriteriaQueries();
- if ( isset($criteriaQueryArr) && is_array($criteriaQueryArr) && count($criteriaQueryArr) == 1 ) {
- print_r($criteriaQueryArr);
- list($criteriaId, $criteriaSQL) = $criteriaQueryArr;
- //should have 1 to 1 relationship
- // foreach ($criteriaQueryArr as $key => $val) {
- // $criteriaId = $key;
- // $criteriaSQL = $val;
- // break;
- // }
- $replaceDataArr = array("[user_id]" => $userObj->getId());
- foreach ( $replaceDataArr as $replaceField => $replaceValue ) {
- $criteriaSQL = str_replace($replaceField, $replaceValue, $criteriaSQL);
- }
- print($criteriaId . " " . $criteriaSQL);
- $dbLink = new DatabaseWrapper();
- $dbLink->execute($criteriaSQL);
- if ( $dbLink->getRowCount() == 1 ) {
- static::$_criteriaArr[$criteriaId] = true;
- } else {
- static::$_criteriaArr[$criteriaId] = false;
- }
- }
- //execute query
- }
Add Comment
Please, Sign In to add comment