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/ContactType.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:ab18da73e77c120a3b3797acdd86a312)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Contact_DAO_ContactType constructor.
40 class CRM_Contact_DAO_ContactType
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_contact_type';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Internal name of Contact Type (or Subtype).
66 * localized Name of Contact Type.
72 * localized Optional verbose description of the type.
78 * URL of image if any.
84 * Optional FK to parent contact type.
90 * Is this entry active?
96 * Is this contact type a predefined system type
104 function __construct() {
105 $this->__table
= 'civicrm_contact_type';
106 parent
::__construct();
109 * Returns foreign keys and entity references.
112 * [CRM_Core_Reference_Interface]
114 static function getReferenceColumns() {
115 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
116 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
117 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName() , 'parent_id', 'civicrm_contact_type', 'id');
118 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
120 return Civi
::$statics[__CLASS__
]['links'];
123 * Returns all the column names of this table
127 static function &fields() {
128 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
129 Civi
::$statics[__CLASS__
]['fields'] = array(
132 'type' => CRM_Utils_Type
::T_INT
,
133 'title' => ts('Contact Type ID') ,
134 'description' => 'Contact Type ID',
136 'table_name' => 'civicrm_contact_type',
137 'entity' => 'ContactType',
138 'bao' => 'CRM_Contact_BAO_ContactType',
142 'type' => CRM_Utils_Type
::T_STRING
,
143 'title' => ts('Name') ,
144 'description' => 'Internal name of Contact Type (or Subtype).',
146 'size' => CRM_Utils_Type
::BIG
,
147 'table_name' => 'civicrm_contact_type',
148 'entity' => 'ContactType',
149 'bao' => 'CRM_Contact_BAO_ContactType',
153 'type' => CRM_Utils_Type
::T_STRING
,
154 'title' => ts('Contact Type Label') ,
155 'description' => 'localized Name of Contact Type.',
157 'size' => CRM_Utils_Type
::BIG
,
158 'table_name' => 'civicrm_contact_type',
159 'entity' => 'ContactType',
160 'bao' => 'CRM_Contact_BAO_ContactType',
162 'description' => array(
163 'name' => 'description',
164 'type' => CRM_Utils_Type
::T_TEXT
,
165 'title' => ts('Contact Type Description') ,
166 'description' => 'localized Optional verbose description of the type.',
169 'table_name' => 'civicrm_contact_type',
170 'entity' => 'ContactType',
171 'bao' => 'CRM_Contact_BAO_ContactType',
173 'type' => 'TextArea',
176 'image_URL' => array(
177 'name' => 'image_URL',
178 'type' => CRM_Utils_Type
::T_STRING
,
179 'title' => ts('Contact Type Image URL') ,
180 'description' => 'URL of image if any.',
182 'size' => CRM_Utils_Type
::HUGE
,
183 'table_name' => 'civicrm_contact_type',
184 'entity' => 'ContactType',
185 'bao' => 'CRM_Contact_BAO_ContactType',
187 'parent_id' => array(
188 'name' => 'parent_id',
189 'type' => CRM_Utils_Type
::T_INT
,
190 'title' => ts('Contact Type Parent') ,
191 'description' => 'Optional FK to parent contact type.',
192 'table_name' => 'civicrm_contact_type',
193 'entity' => 'ContactType',
194 'bao' => 'CRM_Contact_BAO_ContactType',
195 'FKClassName' => 'CRM_Contact_DAO_ContactType',
196 'pseudoconstant' => array(
197 'table' => 'civicrm_contact_type',
199 'labelColumn' => 'label',
200 'condition' => 'parent_id IS NULL',
203 'is_active' => array(
204 'name' => 'is_active',
205 'type' => CRM_Utils_Type
::T_BOOLEAN
,
206 'title' => ts('Contact Type Is Active?') ,
207 'description' => 'Is this entry active?',
208 'table_name' => 'civicrm_contact_type',
209 'entity' => 'ContactType',
210 'bao' => 'CRM_Contact_BAO_ContactType',
212 'is_reserved' => array(
213 'name' => 'is_reserved',
214 'type' => CRM_Utils_Type
::T_BOOLEAN
,
215 'title' => ts('Contact Type is Reserved?') ,
216 'description' => 'Is this contact type a predefined system type',
217 'table_name' => 'civicrm_contact_type',
218 'entity' => 'ContactType',
219 'bao' => 'CRM_Contact_BAO_ContactType',
222 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
224 return Civi
::$statics[__CLASS__
]['fields'];
227 * Return a mapping from field-name to the corresponding key (as used in fields()).
230 * Array(string $name => string $uniqueName).
232 static function &fieldKeys() {
233 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
234 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
236 return Civi
::$statics[__CLASS__
]['fieldKeys'];
239 * Returns the names of this table
243 static function getTableName() {
244 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
247 * Returns if this table needs to be logged
255 * Returns the list of fields that can be imported
257 * @param bool $prefix
261 static function &import($prefix = false) {
262 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contact_type', $prefix, array());
266 * Returns the list of fields that can be exported
268 * @param bool $prefix
272 static function &export($prefix = false) {
273 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contact_type', $prefix, array());