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/ContactType.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:5cd581b1cd8b3dc4f942b1612a1daff0)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Contact_DAO_ContactType
extends CRM_Core_DAO
{
39 * static instance to hold the table name
43 static $_tableName = 'civicrm_contact_type';
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
58 * Internal name of Contact Type (or Subtype).
64 * localized Name of Contact Type.
70 * localized Optional verbose description of the type.
76 * URL of image if any.
82 * Optional FK to parent contact type.
88 * Is this entry active?
94 * Is this contact type a predefined system type
102 * @return civicrm_contact_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',
139 'type' => CRM_Utils_Type
::T_STRING
,
140 'title' => ts('Name') ,
141 'description' => 'Internal name of Contact Type (or Subtype).',
143 'size' => CRM_Utils_Type
::BIG
,
147 'type' => CRM_Utils_Type
::T_STRING
,
148 'title' => ts('Contact Type Label') ,
149 'description' => 'localized Name of Contact Type.',
151 'size' => CRM_Utils_Type
::BIG
,
153 'description' => array(
154 'name' => 'description',
155 'type' => CRM_Utils_Type
::T_TEXT
,
156 'title' => ts('Contact Type Description') ,
157 'description' => 'localized Optional verbose description of the type.',
161 'type' => 'TextArea',
164 'image_URL' => array(
165 'name' => 'image_URL',
166 'type' => CRM_Utils_Type
::T_STRING
,
167 'title' => ts('Contact Type Image URL') ,
168 'description' => 'URL of image if any.',
170 'size' => CRM_Utils_Type
::HUGE
,
172 'parent_id' => array(
173 'name' => 'parent_id',
174 'type' => CRM_Utils_Type
::T_INT
,
175 'title' => ts('Contact Type Parent') ,
176 'description' => 'Optional FK to parent contact type.',
177 'FKClassName' => 'CRM_Contact_DAO_ContactType',
178 'pseudoconstant' => array(
179 'table' => 'civicrm_contact_type',
181 'labelColumn' => 'label',
182 'condition' => 'parent_id IS NULL',
185 'is_active' => array(
186 'name' => 'is_active',
187 'type' => CRM_Utils_Type
::T_BOOLEAN
,
188 'title' => ts('Contact Type Is Active?') ,
189 'description' => 'Is this entry active?',
191 'is_reserved' => array(
192 'name' => 'is_reserved',
193 'type' => CRM_Utils_Type
::T_BOOLEAN
,
194 'title' => ts('Contact Type is Reserved?') ,
195 'description' => 'Is this contact type a predefined system type',
198 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
200 return Civi
::$statics[__CLASS__
]['fields'];
203 * Return a mapping from field-name to the corresponding key (as used in fields()).
206 * Array(string $name => string $uniqueName).
208 static function &fieldKeys() {
209 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
210 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
212 return Civi
::$statics[__CLASS__
]['fieldKeys'];
215 * Returns the names of this table
219 static function getTableName() {
220 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
223 * Returns if this table needs to be logged
231 * Returns the list of fields that can be imported
233 * @param bool $prefix
237 static function &import($prefix = false) {
238 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'contact_type', $prefix, array());
242 * Returns the list of fields that can be exported
244 * @param bool $prefix
248 static function &export($prefix = false) {
249 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'contact_type', $prefix, array());