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: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 value to see if we should log any modifications to
46 * this table in the civicrm_log table
58 * Submitted form values for this search
64 * Foreign key to civicrm_mapping used for saved search-builder searches.
70 * Foreign key to civicrm_option value table used for saved custom searches.
74 public $search_custom_id;
76 * the sql where clause if a saved search acl
82 * the tables to be included in a select data
86 public $select_tables;
88 * the tables to be included in the count statement
96 * @return civicrm_saved_search
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',
131 'form_values' => array(
132 'name' => 'form_values',
133 'type' => CRM_Utils_Type
::T_TEXT
,
134 'title' => ts('Submitted Form Values') ,
135 'description' => 'Submitted form values for this search',
137 'where' => 'civicrm_saved_search.form_values',
138 'headerPattern' => '',
142 'mapping_id' => array(
143 'name' => 'mapping_id',
144 'type' => CRM_Utils_Type
::T_INT
,
145 'title' => ts('Mapping ID') ,
146 'description' => 'Foreign key to civicrm_mapping used for saved search-builder searches.',
147 'FKClassName' => 'CRM_Core_DAO_Mapping',
149 'search_custom_id' => array(
150 'name' => 'search_custom_id',
151 'type' => CRM_Utils_Type
::T_INT
,
152 'title' => ts('Option Value ID') ,
153 'description' => 'Foreign key to civicrm_option value table used for saved custom searches.',
155 'where_clause' => array(
156 'name' => 'where_clause',
157 'type' => CRM_Utils_Type
::T_TEXT
,
158 'title' => ts('Where Clause') ,
159 'description' => 'the sql where clause if a saved search acl',
161 'select_tables' => array(
162 'name' => 'select_tables',
163 'type' => CRM_Utils_Type
::T_TEXT
,
164 'title' => ts('Select Tables') ,
165 'description' => 'the tables to be included in a select data',
167 'where_tables' => array(
168 'name' => 'where_tables',
169 'type' => CRM_Utils_Type
::T_TEXT
,
170 'title' => ts('Where Tables') ,
171 'description' => 'the tables to be included in the count statement',
174 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
176 return Civi
::$statics[__CLASS__
]['fields'];
179 * Return a mapping from field-name to the corresponding key (as used in fields()).
182 * Array(string $name => string $uniqueName).
184 static function &fieldKeys() {
185 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
186 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
188 return Civi
::$statics[__CLASS__
]['fieldKeys'];
191 * Returns the names of this table
195 static function getTableName() {
196 return self
::$_tableName;
199 * Returns if this table needs to be logged
207 * Returns the list of fields that can be imported
209 * @param bool $prefix
213 static function &import($prefix = false) {
214 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'saved_search', $prefix, array());
218 * Returns the list of fields that can be exported
220 * @param bool $prefix
224 static function &export($prefix = false) {
225 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'saved_search', $prefix, array());