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:939c0ed6422323450f5b9b00f8da85ad)
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',
111 'type' => CRM_Utils_Type
::T_STRING
,
112 'title' => ts('Module'),
113 'description' => ts('Name of the module which declared this object'),
116 'size' => CRM_Utils_Type
::HUGE
,
117 'where' => 'civicrm_managed.module',
118 'table_name' => 'civicrm_managed',
119 'entity' => 'Managed',
120 'bao' => 'CRM_Core_DAO_Managed',
126 'type' => CRM_Utils_Type
::T_STRING
,
127 'title' => ts('Name'),
128 'description' => ts('Symbolic name used by the module to identify the object'),
130 'size' => CRM_Utils_Type
::HUGE
,
131 'where' => 'civicrm_managed.name',
132 'table_name' => 'civicrm_managed',
133 'entity' => 'Managed',
134 'bao' => 'CRM_Core_DAO_Managed',
139 'name' => 'entity_type',
140 'type' => CRM_Utils_Type
::T_STRING
,
141 'title' => ts('Entity Type'),
142 'description' => ts('API entity type'),
145 'size' => CRM_Utils_Type
::BIG
,
146 'where' => 'civicrm_managed.entity_type',
147 'table_name' => 'civicrm_managed',
148 'entity' => 'Managed',
149 'bao' => 'CRM_Core_DAO_Managed',
154 'name' => 'entity_id',
155 'type' => CRM_Utils_Type
::T_INT
,
156 'title' => ts('Entity ID'),
157 'description' => ts('Foreign key to the referenced item.'),
159 'where' => 'civicrm_managed.entity_id',
160 'table_name' => 'civicrm_managed',
161 'entity' => 'Managed',
162 'bao' => 'CRM_Core_DAO_Managed',
168 'type' => CRM_Utils_Type
::T_STRING
,
169 'title' => ts('Cleanup Setting'),
170 'description' => ts('Policy on when to cleanup entity (always, never, unused)'),
172 'size' => CRM_Utils_Type
::MEDIUM
,
173 'where' => 'civicrm_managed.cleanup',
174 'table_name' => 'civicrm_managed',
175 'entity' => 'Managed',
176 'bao' => 'CRM_Core_DAO_Managed',
181 'pseudoconstant' => [
182 'callback' => 'CRM_Core_ManagedEntities::getCleanupOptions',
187 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
189 return Civi
::$statics[__CLASS__
]['fields'];
193 * Return a mapping from field-name to the corresponding key (as used in fields()).
196 * Array(string $name => string $uniqueName).
198 public static function &fieldKeys() {
199 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
200 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
202 return Civi
::$statics[__CLASS__
]['fieldKeys'];
206 * Returns the names of this table
210 public static function getTableName() {
211 return self
::$_tableName;
215 * Returns if this table needs to be logged
219 public function getLog() {
224 * Returns the list of fields that can be imported
226 * @param bool $prefix
230 public static function &import($prefix = FALSE) {
231 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'managed', $prefix, []);
236 * Returns the list of fields that can be exported
238 * @param bool $prefix
242 public static function &export($prefix = FALSE) {
243 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'managed', $prefix, []);
248 * Returns the list of indices
250 * @param bool $localize
254 public static function indices($localize = TRUE) {
256 'UI_managed_module_name' => [
257 'name' => 'UI_managed_module_name',
262 'localizable' => FALSE,
263 'sig' => 'civicrm_managed::0::module::name',
265 'UI_managed_entity' => [
266 'name' => 'UI_managed_entity',
271 'localizable' => FALSE,
272 'sig' => 'civicrm_managed::0::entity_type::entity_id',
275 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;