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:341e6ee8dbeb3ab714034368c32837f1)
13 * Database access object for the Managed entity.
15 class CRM_Core_DAO_Managed
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_managed';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * Name of the module which declared this object
46 * Symbolic name used by the module to identify the object
60 * Foreign key to the referenced item.
67 * Policy on when to cleanup entity (always, never, unused)
76 public function __construct() {
77 $this->__table
= 'civicrm_managed';
78 parent
::__construct();
82 * Returns localized title of this entity.
84 public static function getEntityTitle() {
85 return ts('Manageds');
89 * Returns all the column names of this table
93 public static function &fields() {
94 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
95 Civi
::$statics[__CLASS__
]['fields'] = [
98 'type' => CRM_Utils_Type
::T_INT
,
99 'title' => ts('Managed ID'),
100 'description' => ts('Surrogate Key'),
102 'where' => 'civicrm_managed.id',
103 'table_name' => 'civicrm_managed',
104 'entity' => 'Managed',
105 'bao' => 'CRM_Core_DAO_Managed',
110 'type' => CRM_Utils_Type
::T_STRING
,
111 'title' => ts('Module'),
112 'description' => ts('Name of the module which declared this object'),
115 'size' => CRM_Utils_Type
::HUGE
,
116 'where' => 'civicrm_managed.module',
117 'table_name' => 'civicrm_managed',
118 'entity' => 'Managed',
119 'bao' => 'CRM_Core_DAO_Managed',
124 'type' => CRM_Utils_Type
::T_STRING
,
125 'title' => ts('Name'),
126 'description' => ts('Symbolic name used by the module to identify the object'),
128 'size' => CRM_Utils_Type
::HUGE
,
129 'where' => 'civicrm_managed.name',
130 'table_name' => 'civicrm_managed',
131 'entity' => 'Managed',
132 'bao' => 'CRM_Core_DAO_Managed',
136 'name' => 'entity_type',
137 'type' => CRM_Utils_Type
::T_STRING
,
138 'title' => ts('Entity Type'),
139 'description' => ts('API entity type'),
142 'size' => CRM_Utils_Type
::BIG
,
143 'where' => 'civicrm_managed.entity_type',
144 'table_name' => 'civicrm_managed',
145 'entity' => 'Managed',
146 'bao' => 'CRM_Core_DAO_Managed',
150 'name' => 'entity_id',
151 'type' => CRM_Utils_Type
::T_INT
,
152 'title' => ts('Entity ID'),
153 'description' => ts('Foreign key to the referenced item.'),
155 'where' => 'civicrm_managed.entity_id',
156 'table_name' => 'civicrm_managed',
157 'entity' => 'Managed',
158 'bao' => 'CRM_Core_DAO_Managed',
163 'type' => CRM_Utils_Type
::T_STRING
,
164 'title' => ts('Cleanup Setting'),
165 'description' => ts('Policy on when to cleanup entity (always, never, unused)'),
167 'size' => CRM_Utils_Type
::MEDIUM
,
168 'where' => 'civicrm_managed.cleanup',
169 'table_name' => 'civicrm_managed',
170 'entity' => 'Managed',
171 'bao' => 'CRM_Core_DAO_Managed',
176 'pseudoconstant' => [
177 'callback' => 'CRM_Core_ManagedEntities::getCleanupOptions',
181 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
183 return Civi
::$statics[__CLASS__
]['fields'];
187 * Return a mapping from field-name to the corresponding key (as used in fields()).
190 * Array(string $name => string $uniqueName).
192 public static function &fieldKeys() {
193 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
194 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
196 return Civi
::$statics[__CLASS__
]['fieldKeys'];
200 * Returns the names of this table
204 public static function getTableName() {
205 return self
::$_tableName;
209 * Returns if this table needs to be logged
213 public function getLog() {
218 * Returns the list of fields that can be imported
220 * @param bool $prefix
224 public static function &import($prefix = FALSE) {
225 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'managed', $prefix, []);
230 * Returns the list of fields that can be exported
232 * @param bool $prefix
236 public static function &export($prefix = FALSE) {
237 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'managed', $prefix, []);
242 * Returns the list of indices
244 * @param bool $localize
248 public static function indices($localize = TRUE) {
250 'UI_managed_module_name' => [
251 'name' => 'UI_managed_module_name',
256 'localizable' => FALSE,
257 'sig' => 'civicrm_managed::0::module::name',
259 'UI_managed_entity' => [
260 'name' => 'UI_managed_entity',
265 'localizable' => FALSE,
266 'sig' => 'civicrm_managed::0::entity_type::entity_id',
269 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;