3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
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-2017
31 * Generated from xml/schema/CRM/Contact/SavedSearch.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:8e799b35db1b6a38deee5a757d4183c0)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Contact_DAO_SavedSearch constructor.
40 class CRM_Contact_DAO_SavedSearch
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_saved_search';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Submitted form values for this search
66 * Foreign key to civicrm_mapping used for saved search-builder searches.
72 * Foreign key to civicrm_option value table used for saved custom searches.
76 public $search_custom_id;
78 * the sql where clause if a saved search acl
84 * the tables to be included in a select data
88 public $select_tables;
90 * the tables to be included in the count statement
98 function __construct() {
99 $this->__table
= 'civicrm_saved_search';
100 parent
::__construct();
103 * Returns foreign keys and entity references.
106 * [CRM_Core_Reference_Interface]
108 static function getReferenceColumns() {
109 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
110 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
111 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'mapping_id', 'civicrm_mapping', 'id');
112 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
114 return Civi
::$statics[__CLASS__
]['links'];
117 * Returns all the column names of this table
121 static function &fields() {
122 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
123 Civi
::$statics[__CLASS__
]['fields'] = array(
126 'type' => CRM_Utils_Type
::T_INT
,
127 'title' => ts('Saved Search ID') ,
128 'description' => 'Saved Search ID',
130 'table_name' => 'civicrm_saved_search',
131 'entity' => 'SavedSearch',
132 'bao' => 'CRM_Contact_BAO_SavedSearch',
135 'form_values' => array(
136 'name' => 'form_values',
137 'type' => CRM_Utils_Type
::T_TEXT
,
138 'title' => ts('Submitted Form Values') ,
139 'description' => 'Submitted form values for this search',
141 'where' => 'civicrm_saved_search.form_values',
142 'headerPattern' => '',
145 'table_name' => 'civicrm_saved_search',
146 'entity' => 'SavedSearch',
147 'bao' => 'CRM_Contact_BAO_SavedSearch',
150 'mapping_id' => array(
151 'name' => 'mapping_id',
152 'type' => CRM_Utils_Type
::T_INT
,
153 'title' => ts('Mapping ID') ,
154 'description' => 'Foreign key to civicrm_mapping used for saved search-builder searches.',
155 'table_name' => 'civicrm_saved_search',
156 'entity' => 'SavedSearch',
157 'bao' => 'CRM_Contact_BAO_SavedSearch',
159 'FKClassName' => 'CRM_Core_DAO_Mapping',
161 'search_custom_id' => array(
162 'name' => 'search_custom_id',
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('Option Value ID') ,
165 'description' => 'Foreign key to civicrm_option value table used for saved custom searches.',
166 'table_name' => 'civicrm_saved_search',
167 'entity' => 'SavedSearch',
168 'bao' => 'CRM_Contact_BAO_SavedSearch',
171 'where_clause' => array(
172 'name' => 'where_clause',
173 'type' => CRM_Utils_Type
::T_TEXT
,
174 'title' => ts('Where Clause') ,
175 'description' => 'the sql where clause if a saved search acl',
176 'table_name' => 'civicrm_saved_search',
177 'entity' => 'SavedSearch',
178 'bao' => 'CRM_Contact_BAO_SavedSearch',
181 'select_tables' => array(
182 'name' => 'select_tables',
183 'type' => CRM_Utils_Type
::T_TEXT
,
184 'title' => ts('Select Tables') ,
185 'description' => 'the tables to be included in a select data',
186 'table_name' => 'civicrm_saved_search',
187 'entity' => 'SavedSearch',
188 'bao' => 'CRM_Contact_BAO_SavedSearch',
191 'where_tables' => array(
192 'name' => 'where_tables',
193 'type' => CRM_Utils_Type
::T_TEXT
,
194 'title' => ts('Where Tables') ,
195 'description' => 'the tables to be included in the count statement',
196 'table_name' => 'civicrm_saved_search',
197 'entity' => 'SavedSearch',
198 'bao' => 'CRM_Contact_BAO_SavedSearch',
202 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
204 return Civi
::$statics[__CLASS__
]['fields'];
207 * Return a mapping from field-name to the corresponding key (as used in fields()).
210 * Array(string $name => string $uniqueName).
212 static function &fieldKeys() {
213 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
214 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
216 return Civi
::$statics[__CLASS__
]['fieldKeys'];
219 * Returns the names of this table
223 static function getTableName() {
224 return self
::$_tableName;
227 * Returns if this table needs to be logged
235 * Returns the list of fields that can be imported
237 * @param bool $prefix
241 static function &import($prefix = false) {
242 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'saved_search', $prefix, array());
246 * Returns the list of fields that can be exported
248 * @param bool $prefix
252 static function &export($prefix = false) {
253 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'saved_search', $prefix, array());
257 * Returns the list of indices
259 public static function indices($localize = TRUE) {
261 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;