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:3c6ae22144ccb74c38f5a043e5edf7db)
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',
119 'type' => CRM_Utils_Type
::T_STRING
,
120 'title' => ts('Module'),
121 'description' => ts('Name of the module which declared this object'),
124 'size' => CRM_Utils_Type
::HUGE
,
125 'where' => 'civicrm_managed.module',
126 'table_name' => 'civicrm_managed',
127 'entity' => 'Managed',
128 'bao' => 'CRM_Core_DAO_Managed',
134 'type' => CRM_Utils_Type
::T_STRING
,
135 'title' => ts('Name'),
136 'description' => ts('Symbolic name used by the module to identify the object'),
138 'size' => CRM_Utils_Type
::HUGE
,
139 'where' => 'civicrm_managed.name',
140 'table_name' => 'civicrm_managed',
141 'entity' => 'Managed',
142 'bao' => 'CRM_Core_DAO_Managed',
147 'name' => 'entity_type',
148 'type' => CRM_Utils_Type
::T_STRING
,
149 'title' => ts('Entity Type'),
150 'description' => ts('API entity type'),
153 'size' => CRM_Utils_Type
::BIG
,
154 'where' => 'civicrm_managed.entity_type',
155 'table_name' => 'civicrm_managed',
156 'entity' => 'Managed',
157 'bao' => 'CRM_Core_DAO_Managed',
162 'name' => 'entity_id',
163 'type' => CRM_Utils_Type
::T_INT
,
164 'title' => ts('Entity ID'),
165 'description' => ts('Foreign key to the referenced item.'),
167 'where' => 'civicrm_managed.entity_id',
168 'table_name' => 'civicrm_managed',
169 'entity' => 'Managed',
170 'bao' => 'CRM_Core_DAO_Managed',
176 'type' => CRM_Utils_Type
::T_STRING
,
177 'title' => ts('Cleanup Setting'),
178 'description' => ts('Policy on when to cleanup entity (always, never, unused)'),
180 'size' => CRM_Utils_Type
::MEDIUM
,
181 'where' => 'civicrm_managed.cleanup',
182 'table_name' => 'civicrm_managed',
183 'entity' => 'Managed',
184 'bao' => 'CRM_Core_DAO_Managed',
189 'pseudoconstant' => [
190 'callback' => 'CRM_Core_ManagedEntities::getCleanupOptions',
195 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
197 return Civi
::$statics[__CLASS__
]['fields'];
201 * Return a mapping from field-name to the corresponding key (as used in fields()).
204 * Array(string $name => string $uniqueName).
206 public static function &fieldKeys() {
207 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
208 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
210 return Civi
::$statics[__CLASS__
]['fieldKeys'];
214 * Returns the names of this table
218 public static function getTableName() {
219 return self
::$_tableName;
223 * Returns if this table needs to be logged
227 public function getLog() {
232 * Returns the list of fields that can be imported
234 * @param bool $prefix
238 public static function &import($prefix = FALSE) {
239 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'managed', $prefix, []);
244 * Returns the list of fields that can be exported
246 * @param bool $prefix
250 public static function &export($prefix = FALSE) {
251 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'managed', $prefix, []);
256 * Returns the list of indices
258 * @param bool $localize
262 public static function indices($localize = TRUE) {
264 'UI_managed_module_name' => [
265 'name' => 'UI_managed_module_name',
270 'localizable' => FALSE,
271 'sig' => 'civicrm_managed::0::module::name',
273 'UI_managed_entity' => [
274 'name' => 'UI_managed_entity',
279 'localizable' => FALSE,
280 'sig' => 'civicrm_managed::0::entity_type::entity_id',
283 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;