FortuneCriteria.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /** @package HelloWorld::Model */
  3. /** import supporting libraries */
  4. require_once("DAO/FortuneCriteriaDAO.php");
  5. /**
  6. * The FortuneCriteria class extends FortuneDAOCriteria and is used
  7. * to query the database for objects and collections
  8. *
  9. * @inheritdocs
  10. * @package HelloWorld::Model
  11. * @author ClassBuilder
  12. * @version 1.0
  13. */
  14. class FortuneCriteria extends FortuneCriteriaDAO
  15. {
  16. /**
  17. * GetFieldFromProp returns the DB column for a given class property
  18. *
  19. * If any fields that are not part of the table need to be supported
  20. * by this Criteria class, they can be added inside the switch statement
  21. * in this method
  22. *
  23. * @see Criteria::GetFieldFromProp()
  24. */
  25. /*
  26. public function GetFieldFromProp($propname)
  27. {
  28. switch($propname)
  29. {
  30. case 'CustomProp1':
  31. return 'my_db_column_1';
  32. case 'CustomProp2':
  33. return 'my_db_column_2';
  34. default:
  35. return parent::GetFieldFromProp($propname);
  36. }
  37. }
  38. */
  39. /**
  40. * For custom query logic, you may override OnProcess and set the $this->_where to whatever
  41. * sql code is necessary. If you choose to manually set _where then Phreeze will not touch
  42. * your where clause at all and so any of the standard property names will be ignored
  43. *
  44. * @see Criteria::OnPrepare()
  45. */
  46. /*
  47. function OnPrepare()
  48. {
  49. if ($this->MyCustomField == "special value")
  50. {
  51. // _where must begin with "where"
  52. $this->_where = "where db_field ....";
  53. }
  54. }
  55. */
  56. }
  57. ?>