5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/Managed.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:6f8403a1993eb2636a67833602db14ab)
13 * Database access object for the Managed entity.
15 class CRM_Core_DAO_Managed
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '4.2';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_managed';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
41 * Name of the module which declared this object
48 * Symbolic name used by the module to identify the object
62 * Foreign key to the referenced item.
69 * Policy on when to cleanup entity (always, never, unused)
78 public function __construct() {
79 $this->__table
= 'civicrm_managed';
80 parent
::__construct();
84 * Returns localized title of this entity.
87 * Whether to return the plural version of the title.
89 public static function getEntityTitle($plural = FALSE) {
90 return $plural ?
ts('Manageds') : ts('Managed');
94 * Returns all the column names of this table
98 public static function &fields() {
99 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
100 Civi
::$statics[__CLASS__
]['fields'] = [
103 'type' => CRM_Utils_Type
::T_INT
,
104 'title' => ts('Managed ID'),
105 'description' => ts('Surrogate Key'),
107 'where' => 'civicrm_managed.id',
108 'table_name' => 'civicrm_managed',
109 'entity' => 'Managed',
110 'bao' => 'CRM_Core_DAO_Managed',
120 'type' => CRM_Utils_Type
::T_STRING
,
121 'title' => ts('Module'),
122 'description' => ts('Name of the module which declared this object'),
125 'size' => CRM_Utils_Type
::HUGE
,
126 'where' => 'civicrm_managed.module',
127 'table_name' => 'civicrm_managed',
128 'entity' => 'Managed',
129 'bao' => 'CRM_Core_DAO_Managed',
135 'type' => CRM_Utils_Type
::T_STRING
,
136 'title' => ts('Name'),
137 'description' => ts('Symbolic name used by the module to identify the object'),
139 'size' => CRM_Utils_Type
::HUGE
,
140 'where' => 'civicrm_managed.name',
141 'table_name' => 'civicrm_managed',
142 'entity' => 'Managed',
143 'bao' => 'CRM_Core_DAO_Managed',
148 'name' => 'entity_type',
149 'type' => CRM_Utils_Type
::T_STRING
,
150 'title' => ts('Entity Type'),
151 'description' => ts('API entity type'),
154 'size' => CRM_Utils_Type
::BIG
,
155 'where' => 'civicrm_managed.entity_type',
156 'table_name' => 'civicrm_managed',
157 'entity' => 'Managed',
158 'bao' => 'CRM_Core_DAO_Managed',
163 'name' => 'entity_id',
164 'type' => CRM_Utils_Type
::T_INT
,
165 'title' => ts('Entity ID'),
166 'description' => ts('Foreign key to the referenced item.'),
168 'where' => 'civicrm_managed.entity_id',
169 'table_name' => 'civicrm_managed',
170 'entity' => 'Managed',
171 'bao' => 'CRM_Core_DAO_Managed',
177 'type' => CRM_Utils_Type
::T_STRING
,
178 'title' => ts('Cleanup Setting'),
179 'description' => ts('Policy on when to cleanup entity (always, never, unused)'),
181 'size' => CRM_Utils_Type
::MEDIUM
,
182 'where' => 'civicrm_managed.cleanup',
183 'table_name' => 'civicrm_managed',
184 'entity' => 'Managed',
185 'bao' => 'CRM_Core_DAO_Managed',
190 'pseudoconstant' => [
191 'callback' => 'CRM_Core_ManagedEntities::getCleanupOptions',
196 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
198 return Civi
::$statics[__CLASS__
]['fields'];
202 * Return a mapping from field-name to the corresponding key (as used in fields()).
205 * Array(string $name => string $uniqueName).
207 public static function &fieldKeys() {
208 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
209 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
211 return Civi
::$statics[__CLASS__
]['fieldKeys'];
215 * Returns the names of this table
219 public static function getTableName() {
220 return self
::$_tableName;
224 * Returns if this table needs to be logged
228 public function getLog() {
233 * Returns the list of fields that can be imported
235 * @param bool $prefix
239 public static function &import($prefix = FALSE) {
240 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'managed', $prefix, []);
245 * Returns the list of fields that can be exported
247 * @param bool $prefix
251 public static function &export($prefix = FALSE) {
252 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'managed', $prefix, []);
257 * Returns the list of indices
259 * @param bool $localize
263 public static function indices($localize = TRUE) {
265 'UI_managed_module_name' => [
266 'name' => 'UI_managed_module_name',
271 'localizable' => FALSE,
272 'sig' => 'civicrm_managed::0::module::name',
274 'UI_managed_entity' => [
275 'name' => 'UI_managed_entity',
280 'localizable' => FALSE,
281 'sig' => 'civicrm_managed::0::entity_type::entity_id',
284 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;