3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2016
31 * Generated from xml/schema/CRM/Contact/SavedSearch.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:1972403bedc8ca79674ce1b7f6f3760c)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Contact_DAO_SavedSearch
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_saved_search';
45 * static instance to hold the field values
49 static $_fields = null;
51 * static instance to hold the keys used in $_fields for each field.
55 static $_fieldKeys = null;
57 * static instance to hold the FK relationships
61 static $_links = null;
63 * static instance to hold the values that can
68 static $_import = null;
70 * static instance to hold the values that can
75 static $_export = null;
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
90 * Submitted form values for this search
96 * Foreign key to civicrm_mapping used for saved search-builder searches.
102 * Foreign key to civicrm_option value table used for saved custom searches.
106 public $search_custom_id;
108 * the sql where clause if a saved search acl
112 public $where_clause;
114 * the tables to be included in a select data
118 public $select_tables;
120 * the tables to be included in the count statement
124 public $where_tables;
128 * @return civicrm_saved_search
130 function __construct() {
131 $this->__table
= 'civicrm_saved_search';
132 parent
::__construct();
135 * Returns foreign keys and entity references
138 * [CRM_Core_Reference_Interface]
140 static function getReferenceColumns() {
141 if (!self
::$_links) {
142 self
::$_links = static ::createReferenceColumns(__CLASS__
);
143 self
::$_links[] = new CRM_Core_Reference_Basic(self
::getTableName() , 'mapping_id', 'civicrm_mapping', 'id');
145 return self
::$_links;
148 * Returns all the column names of this table
152 static function &fields() {
153 if (!(self
::$_fields)) {
154 self
::$_fields = array(
157 'type' => CRM_Utils_Type
::T_INT
,
158 'title' => ts('Saved Search ID') ,
159 'description' => 'Saved Search ID',
162 'form_values' => array(
163 'name' => 'form_values',
164 'type' => CRM_Utils_Type
::T_TEXT
,
165 'title' => ts('Submitted Form Values') ,
166 'description' => 'Submitted form values for this search',
168 'where' => 'civicrm_saved_search.form_values',
169 'headerPattern' => '',
173 'mapping_id' => array(
174 'name' => 'mapping_id',
175 'type' => CRM_Utils_Type
::T_INT
,
176 'title' => ts('Mapping ID') ,
177 'description' => 'Foreign key to civicrm_mapping used for saved search-builder searches.',
178 'FKClassName' => 'CRM_Core_DAO_Mapping',
180 'search_custom_id' => array(
181 'name' => 'search_custom_id',
182 'type' => CRM_Utils_Type
::T_INT
,
183 'title' => ts('Option Value ID') ,
184 'description' => 'Foreign key to civicrm_option value table used for saved custom searches.',
186 'where_clause' => array(
187 'name' => 'where_clause',
188 'type' => CRM_Utils_Type
::T_TEXT
,
189 'title' => ts('Where Clause') ,
190 'description' => 'the sql where clause if a saved search acl',
192 'select_tables' => array(
193 'name' => 'select_tables',
194 'type' => CRM_Utils_Type
::T_TEXT
,
195 'title' => ts('Select Tables') ,
196 'description' => 'the tables to be included in a select data',
198 'where_tables' => array(
199 'name' => 'where_tables',
200 'type' => CRM_Utils_Type
::T_TEXT
,
201 'title' => ts('Where Tables') ,
202 'description' => 'the tables to be included in the count statement',
206 return self
::$_fields;
209 * Returns an array containing, for each field, the arary key used for that
210 * field in self::$_fields.
214 static function &fieldKeys() {
215 if (!(self
::$_fieldKeys)) {
216 self
::$_fieldKeys = array(
218 'form_values' => 'form_values',
219 'mapping_id' => 'mapping_id',
220 'search_custom_id' => 'search_custom_id',
221 'where_clause' => 'where_clause',
222 'select_tables' => 'select_tables',
223 'where_tables' => 'where_tables',
226 return self
::$_fieldKeys;
229 * Returns the names of this table
233 static function getTableName() {
234 return self
::$_tableName;
237 * Returns if this table needs to be logged
245 * Returns the list of fields that can be imported
247 * @param bool $prefix
251 static function &import($prefix = false) {
252 if (!(self
::$_import)) {
253 self
::$_import = array();
254 $fields = self
::fields();
255 foreach($fields as $name => $field) {
256 if (CRM_Utils_Array
::value('import', $field)) {
258 self
::$_import['saved_search'] = & $fields[$name];
260 self
::$_import[$name] = & $fields[$name];
265 return self
::$_import;
268 * Returns the list of fields that can be exported
270 * @param bool $prefix
274 static function &export($prefix = false) {
275 if (!(self
::$_export)) {
276 self
::$_export = array();
277 $fields = self
::fields();
278 foreach($fields as $name => $field) {
279 if (CRM_Utils_Array
::value('export', $field)) {
281 self
::$_export['saved_search'] = & $fields[$name];
283 self
::$_export[$name] = & $fields[$name];
288 return self
::$_export;