5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/Managed.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:79f57e32601e72d62755569fbf58c801)
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 all the column names of this table
86 public static function &fields() {
87 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
88 Civi
::$statics[__CLASS__
]['fields'] = [
91 'type' => CRM_Utils_Type
::T_INT
,
92 'title' => ts('Managed ID'),
93 'description' => ts('Surrogate Key'),
95 'where' => 'civicrm_managed.id',
96 'table_name' => 'civicrm_managed',
97 'entity' => 'Managed',
98 'bao' => 'CRM_Core_DAO_Managed',
103 'type' => CRM_Utils_Type
::T_STRING
,
104 'title' => ts('Module'),
105 'description' => ts('Name of the module which declared this object'),
108 'size' => CRM_Utils_Type
::HUGE
,
109 'where' => 'civicrm_managed.module',
110 'table_name' => 'civicrm_managed',
111 'entity' => 'Managed',
112 'bao' => 'CRM_Core_DAO_Managed',
117 'type' => CRM_Utils_Type
::T_STRING
,
118 'title' => ts('Name'),
119 'description' => ts('Symbolic name used by the module to identify the object'),
121 'size' => CRM_Utils_Type
::HUGE
,
122 'where' => 'civicrm_managed.name',
123 'table_name' => 'civicrm_managed',
124 'entity' => 'Managed',
125 'bao' => 'CRM_Core_DAO_Managed',
129 'name' => 'entity_type',
130 'type' => CRM_Utils_Type
::T_STRING
,
131 'title' => ts('Entity Type'),
132 'description' => ts('API entity type'),
135 'size' => CRM_Utils_Type
::BIG
,
136 'where' => 'civicrm_managed.entity_type',
137 'table_name' => 'civicrm_managed',
138 'entity' => 'Managed',
139 'bao' => 'CRM_Core_DAO_Managed',
143 'name' => 'entity_id',
144 'type' => CRM_Utils_Type
::T_INT
,
145 'title' => ts('Entity ID'),
146 'description' => ts('Foreign key to the referenced item.'),
148 'where' => 'civicrm_managed.entity_id',
149 'table_name' => 'civicrm_managed',
150 'entity' => 'Managed',
151 'bao' => 'CRM_Core_DAO_Managed',
156 'type' => CRM_Utils_Type
::T_STRING
,
157 'title' => ts('Cleanup Setting'),
158 'description' => ts('Policy on when to cleanup entity (always, never, unused)'),
160 'size' => CRM_Utils_Type
::MEDIUM
,
161 'where' => 'civicrm_managed.cleanup',
162 'table_name' => 'civicrm_managed',
163 'entity' => 'Managed',
164 'bao' => 'CRM_Core_DAO_Managed',
169 'pseudoconstant' => [
170 'callback' => 'CRM_Core_ManagedEntities::getCleanupOptions',
174 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
176 return Civi
::$statics[__CLASS__
]['fields'];
180 * Return a mapping from field-name to the corresponding key (as used in fields()).
183 * Array(string $name => string $uniqueName).
185 public static function &fieldKeys() {
186 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
187 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
189 return Civi
::$statics[__CLASS__
]['fieldKeys'];
193 * Returns the names of this table
197 public static function getTableName() {
198 return self
::$_tableName;
202 * Returns if this table needs to be logged
206 public function getLog() {
211 * Returns the list of fields that can be imported
213 * @param bool $prefix
217 public static function &import($prefix = FALSE) {
218 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'managed', $prefix, []);
223 * Returns the list of fields that can be exported
225 * @param bool $prefix
229 public static function &export($prefix = FALSE) {
230 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'managed', $prefix, []);
235 * Returns the list of indices
237 * @param bool $localize
241 public static function indices($localize = TRUE) {
243 'UI_managed_module_name' => [
244 'name' => 'UI_managed_module_name',
249 'localizable' => FALSE,
250 'sig' => 'civicrm_managed::0::module::name',
252 'UI_managed_entity' => [
253 'name' => 'UI_managed_entity',
258 'localizable' => FALSE,
259 'sig' => 'civicrm_managed::0::entity_type::entity_id',
262 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;