Guest User

Untitled

a guest
May 28th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. Array ( [2] => SELECT ed_donor_id FROM tbl_eligibility_dates WHERE ed_eligibility_date <= CURRENT_DATE AND ed_donor_id = [user_id] )
  2.  
  3. public function meetsCriteria($userObj) {
  4. $criteriaQueryArr = $this->_getCriteriaQueries();
  5.  
  6. if ( isset($criteriaQueryArr) && is_array($criteriaQueryArr) && count($criteriaQueryArr) == 1 ) {
  7. print_r($criteriaQueryArr);
  8. list($criteriaId, $criteriaSQL) = $criteriaQueryArr;
  9.  
  10. //should have 1 to 1 relationship
  11. // foreach ($criteriaQueryArr as $key => $val) {
  12. // $criteriaId = $key;
  13. // $criteriaSQL = $val;
  14. // break;
  15. // }
  16.  
  17. $replaceDataArr = array("[user_id]" => $userObj->getId());
  18. foreach ( $replaceDataArr as $replaceField => $replaceValue ) {
  19. $criteriaSQL = str_replace($replaceField, $replaceValue, $criteriaSQL);
  20. }
  21. print($criteriaId . " " . $criteriaSQL);
  22. $dbLink = new DatabaseWrapper();
  23. $dbLink->execute($criteriaSQL);
  24.  
  25. if ( $dbLink->getRowCount() == 1 ) {
  26. static::$_criteriaArr[$criteriaId] = true;
  27. } else {
  28. static::$_criteriaArr[$criteriaId] = false;
  29. }
  30. }
  31.  
  32.  
  33. //execute query
  34.  
  35. }
Add Comment
Please, Sign In to add comment