psr12 fixes for new PHP_CodeSniffer (#4795)
[openemr.git] / portal / patient / libs / Model / OnsiteActivityViewCriteria.php
blob05772f3bdcd51b5697dca4bb8071424106304d88
1 <?php
3 /**
4 * OnsiteActivityViewCriteria.php
6 * @package OpenEMR
7 * @link https://www.open-emr.org
8 * @author Jerry Padgett <sjpadgett@gmail.com>
9 * @copyright Copyright (c) 2016-2017 Jerry Padgett <sjpadgett@gmail.com>
10 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 /** import supporting libraries */
14 require_once("DAO/OnsiteActivityViewCriteriaDAO.php");
16 /**
17 * The OnsiteActivityViewCriteria class extends OnsiteActivityViewDAOCriteria and is used
18 * to query the database for objects and collections
20 * @inheritdocs
21 * @package Openemr::Model
22 * @author ClassBuilder
23 * @version 1.0
25 class OnsiteActivityViewCriteria extends OnsiteActivityViewCriteriaDAO
27 /**
28 * GetFieldFromProp returns the DB column for a given class property
30 * If any fields that are not part of the table need to be supported
31 * by this Criteria class, they can be added inside the switch statement
32 * in this method
34 * @see Criteria::GetFieldFromProp()
37 public function GetFieldFromProp($propname)
39 switch($propname)
41 case 'CustomProp1':
42 return 'my_db_column_1';
43 case 'CustomProp2':
44 return 'my_db_column_2';
45 default:
46 return parent::GetFieldFromProp($propname);
51 /**
52 * For custom query logic, you may override OnPrepare and set the $this->_where to whatever
53 * sql code is necessary. If you choose to manually set _where then Phreeze will not touch
54 * your where clause at all and so any of the standard property names will be ignored
56 * @see Criteria::OnPrepare()
59 function OnPrepare()
61 if ($this->MyCustomField == "special value")
63 // _where must begin with "where"
64 $this->_where = "where db_field ....";