2 /** @package Openemr::Model */
6 * Copyright (C) 2016-2017 Jerry Padgett <sjpadgett@gmail.com>
8 * LICENSE: This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as
10 * published by the Free Software Foundation, either version 3 of the
11 * License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 * @author Jerry Padgett <sjpadgett@gmail.com>
23 * @link http://www.open-emr.org
26 /** import supporting libraries */
27 require_once("DAO/UserCriteriaDAO.php");
30 * The UserCriteria class extends UserDAOCriteria and is used
31 * to query the database for objects and collections
34 * @package Openemr::Model
35 * @author ClassBuilder
38 class UserCriteria
extends UserCriteriaDAO
42 * GetFieldFromProp returns the DB column for a given class property
44 * If any fields that are not part of the table need to be supported
45 * by this Criteria class, they can be added inside the switch statement
48 * @see Criteria::GetFieldFromProp()
51 public function GetFieldFromProp($propname)
56 return 'my_db_column_1';
58 return 'my_db_column_2';
60 return parent::GetFieldFromProp($propname);
66 * For custom query logic, you may override OnPrepare and set the $this->_where to whatever
67 * sql code is necessary. If you choose to manually set _where then Phreeze will not touch
68 * your where clause at all and so any of the standard property names will be ignored
70 * @see Criteria::OnPrepare()
75 if ($this->MyCustomField == "special value")
77 // _where must begin with "where"
78 $this->_where = "where db_field ....";