3 +--------------------------------------------------------------------+
4 | CiviCRM Widget Creation Interface (WCI) Version 1.0 |
5 +--------------------------------------------------------------------+
6 | Copyright Zyxware Technologies (c) 2014 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM WCI. |
10 | CiviCRM WCI is free software; you can copy, modify, and distribute |
11 | it under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007. |
14 | CiviCRM WCI is distributed in the hope that it will be useful, |
15 | but 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 along with this program; if not, contact Zyxware |
21 | Technologies at info[AT]zyxware[DOT]com. |
22 +--------------------------------------------------------------------+
28 * @copyright CiviCRM LLC (c) 2004-2013
30 class CRM_Wci_DAO_EmbedCode
extends CRM_Core_DAO
33 * static instance to hold the table name
38 static $_tableName = 'civicrm_wci_embed_code';
40 * static instance to hold the field values
45 static $_fields = null;
47 * static instance to hold the keys used in $_fields for each field.
52 static $_fieldKeys = null;
54 * static instance to hold the FK relationships
59 static $_links = null;
61 * static instance to hold the values that can
67 static $_import = null;
69 * 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
103 function __construct()
105 $this->__table
= 'civicrm_wci_embed_code';
106 parent
::__construct();
109 * return foreign keys and entity references
113 * @return array of CRM_Core_EntityReference
115 static function getReferenceColumns()
117 return self
::$_links;
120 * returns all the column names of this table
125 static function &fields()
127 if (!(self
::$_fields)) {
128 self
::$_fields = array(
129 'embed_code_id' => array(
131 'type' => CRM_Utils_Type
::T_INT
,
132 'title' => ts('WCI embed code Id', array('domain' => 'org.civicrm.wci')) ,
137 'type' => CRM_Utils_Type
::T_STRING
,
138 'title' => ts('embed cide Name', array('domain' => 'org.civicrm.wci')) ,
142 'widget_id' => array(
143 'name' => 'widget_id',
144 'type' => CRM_Utils_Type
::T_INT
,
149 return self
::$_fields;
152 * Returns an array containing, for each field, the arary key used for that
153 * field in self::$_fields.
158 static function &fieldKeys()
160 if (!(self
::$_fieldKeys)) {
161 self
::$_fieldKeys = array(
162 'id' => 'progress_bar_id',
164 'widget_id' => 'widget_id',
167 return self
::$_fieldKeys;
170 * returns the names of this table
176 static function getTableName()
178 return self
::$_tableName;
181 * returns if this table needs to be logged
191 * returns the list of fields that can be imported
197 static function &import($prefix = false)
199 if (!(self
::$_import)) {
200 self
::$_import = array();
201 $fields = self
::fields();
202 foreach($fields as $name => $field) {
203 if (CRM_Utils_Array
::value('import', $field)) {
205 self
::$_import['wci_progress_bar'] = & $fields[$name];
207 self
::$_import[$name] = & $fields[$name];
212 return self
::$_import;
215 * returns the list of fields that can be exported
221 static function &export($prefix = false)
223 if (!(self
::$_export)) {
224 self
::$_export = array();
225 $fields = self
::fields();
226 foreach($fields as $name => $field) {
227 if (CRM_Utils_Array
::value('export', $field)) {
229 self
::$_export['wci_progress_bar'] = & $fields[$name];
231 self
::$_export[$name] = & $fields[$name];
236 return self
::$_export;