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:5e27c0a48637f591ddd474093510e532)
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',
116 'type' => CRM_Utils_Type
::T_STRING
,
117 'title' => ts('Module'),
118 'description' => ts('Name of the module which declared this object'),
121 'size' => CRM_Utils_Type
::HUGE
,
122 'where' => 'civicrm_managed.module',
123 'table_name' => 'civicrm_managed',
124 'entity' => 'Managed',
125 'bao' => 'CRM_Core_DAO_Managed',
131 'type' => CRM_Utils_Type
::T_STRING
,
132 'title' => ts('Name'),
133 'description' => ts('Symbolic name used by the module to identify the object'),
135 'size' => CRM_Utils_Type
::HUGE
,
136 'where' => 'civicrm_managed.name',
137 'table_name' => 'civicrm_managed',
138 'entity' => 'Managed',
139 'bao' => 'CRM_Core_DAO_Managed',
144 'name' => 'entity_type',
145 'type' => CRM_Utils_Type
::T_STRING
,
146 'title' => ts('Entity Type'),
147 'description' => ts('API entity type'),
150 'size' => CRM_Utils_Type
::BIG
,
151 'where' => 'civicrm_managed.entity_type',
152 'table_name' => 'civicrm_managed',
153 'entity' => 'Managed',
154 'bao' => 'CRM_Core_DAO_Managed',
159 'name' => 'entity_id',
160 'type' => CRM_Utils_Type
::T_INT
,
161 'title' => ts('Entity ID'),
162 'description' => ts('Foreign key to the referenced item.'),
164 'where' => 'civicrm_managed.entity_id',
165 'table_name' => 'civicrm_managed',
166 'entity' => 'Managed',
167 'bao' => 'CRM_Core_DAO_Managed',
173 'type' => CRM_Utils_Type
::T_STRING
,
174 'title' => ts('Cleanup Setting'),
175 'description' => ts('Policy on when to cleanup entity (always, never, unused)'),
177 'size' => CRM_Utils_Type
::MEDIUM
,
178 'where' => 'civicrm_managed.cleanup',
179 'table_name' => 'civicrm_managed',
180 'entity' => 'Managed',
181 'bao' => 'CRM_Core_DAO_Managed',
186 'pseudoconstant' => [
187 'callback' => 'CRM_Core_ManagedEntities::getCleanupOptions',
192 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
194 return Civi
::$statics[__CLASS__
]['fields'];
198 * Return a mapping from field-name to the corresponding key (as used in fields()).
201 * Array(string $name => string $uniqueName).
203 public static function &fieldKeys() {
204 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
205 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
207 return Civi
::$statics[__CLASS__
]['fieldKeys'];
211 * Returns the names of this table
215 public static function getTableName() {
216 return self
::$_tableName;
220 * Returns if this table needs to be logged
224 public function getLog() {
229 * Returns the list of fields that can be imported
231 * @param bool $prefix
235 public static function &import($prefix = FALSE) {
236 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'managed', $prefix, []);
241 * Returns the list of fields that can be exported
243 * @param bool $prefix
247 public static function &export($prefix = FALSE) {
248 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'managed', $prefix, []);
253 * Returns the list of indices
255 * @param bool $localize
259 public static function indices($localize = TRUE) {
261 'UI_managed_module_name' => [
262 'name' => 'UI_managed_module_name',
267 'localizable' => FALSE,
268 'sig' => 'civicrm_managed::0::module::name',
270 'UI_managed_entity' => [
271 'name' => 'UI_managed_entity',
276 'localizable' => FALSE,
277 'sig' => 'civicrm_managed::0::entity_type::entity_id',
280 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;