5 * @copyright CiviCRM LLC (c) 2004-2017
7 * Generated from xml/schema/CRM/Core/Managed.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:49d518366db653a210558061604fb8cf)
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 static $_tableName = 'civicrm_managed';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => 'Surrogate Key',
95 'table_name' => 'civicrm_managed',
96 'entity' => 'Managed',
97 'bao' => 'CRM_Core_DAO_Managed',
102 'type' => CRM_Utils_Type
::T_STRING
,
103 'title' => ts('Module'),
104 'description' => 'Name of the module which declared this object',
107 'size' => CRM_Utils_Type
::HUGE
,
108 'table_name' => 'civicrm_managed',
109 'entity' => 'Managed',
110 'bao' => 'CRM_Core_DAO_Managed',
115 'type' => CRM_Utils_Type
::T_STRING
,
116 'title' => ts('Name'),
117 'description' => 'Symbolic name used by the module to identify the object',
119 'size' => CRM_Utils_Type
::HUGE
,
120 'table_name' => 'civicrm_managed',
121 'entity' => 'Managed',
122 'bao' => 'CRM_Core_DAO_Managed',
126 'name' => 'entity_type',
127 'type' => CRM_Utils_Type
::T_STRING
,
128 'title' => ts('Entity Type'),
129 'description' => 'API entity type',
132 'size' => CRM_Utils_Type
::BIG
,
133 'table_name' => 'civicrm_managed',
134 'entity' => 'Managed',
135 'bao' => 'CRM_Core_DAO_Managed',
139 'name' => 'entity_id',
140 'type' => CRM_Utils_Type
::T_INT
,
141 'title' => ts('Entity ID'),
142 'description' => 'Foreign key to the referenced item.',
144 'table_name' => 'civicrm_managed',
145 'entity' => 'Managed',
146 'bao' => 'CRM_Core_DAO_Managed',
151 'type' => CRM_Utils_Type
::T_STRING
,
152 'title' => ts('Cleanup Setting'),
153 'description' => 'Policy on when to cleanup entity (always, never, unused)',
155 'size' => CRM_Utils_Type
::MEDIUM
,
156 'table_name' => 'civicrm_managed',
157 'entity' => 'Managed',
158 'bao' => 'CRM_Core_DAO_Managed',
163 'pseudoconstant' => [
164 'callback' => 'CRM_Core_ManagedEntities::getCleanupOptions',
168 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
170 return Civi
::$statics[__CLASS__
]['fields'];
174 * Return a mapping from field-name to the corresponding key (as used in fields()).
177 * Array(string $name => string $uniqueName).
179 public static function &fieldKeys() {
180 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
181 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
183 return Civi
::$statics[__CLASS__
]['fieldKeys'];
187 * Returns the names of this table
191 public static function getTableName() {
192 return self
::$_tableName;
196 * Returns if this table needs to be logged
200 public function getLog() {
205 * Returns the list of fields that can be imported
207 * @param bool $prefix
211 public static function &import($prefix = FALSE) {
212 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'managed', $prefix, []);
217 * Returns the list of fields that can be exported
219 * @param bool $prefix
223 public static function &export($prefix = FALSE) {
224 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'managed', $prefix, []);
229 * Returns the list of indices
231 * @param bool $localize
235 public static function indices($localize = TRUE) {
237 'UI_managed_module_name' => [
238 'name' => 'UI_managed_module_name',
243 'localizable' => FALSE,
244 'sig' => 'civicrm_managed::0::module::name',
246 'UI_managed_entity' => [
247 'name' => 'UI_managed_entity',
252 'localizable' => FALSE,
253 'sig' => 'civicrm_managed::0::entity_type::entity_id',
256 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;