+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
-| Copyright CiviCRM LLC (c) 2004-2016 |
+| Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
*/
/**
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
*
* Generated from xml/schema/CRM/Queue/QueueItem.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:45218486c40b902ee5e043e22b1a7d20)
+ * (GenCodeChecksum:a7927e0d742d5a5600ffe80c75d90bf6)
*/
require_once 'CRM/Core/DAO.php';
require_once 'CRM/Utils/Type.php';
+/**
+ * CRM_Queue_DAO_QueueItem constructor.
+ */
class CRM_Queue_DAO_QueueItem extends CRM_Core_DAO {
/**
- * static instance to hold the table name
+ * Static instance to hold the table name.
*
* @var string
*/
static $_tableName = 'civicrm_queue_item';
/**
- * static instance to hold the field values
- *
- * @var array
- */
- static $_fields = null;
- /**
- * static instance to hold the keys used in $_fields for each field.
- *
- * @var array
- */
- static $_fieldKeys = null;
- /**
- * static instance to hold the FK relationships
- *
- * @var string
- */
- static $_links = null;
- /**
- * static instance to hold the values that can
- * be imported
- *
- * @var array
- */
- static $_import = null;
- /**
- * static instance to hold the values that can
- * be exported
- *
- * @var array
- */
- static $_export = null;
- /**
- * static value to see if we should log any modifications to
- * this table in the civicrm_log table
+ * Should CiviCRM log any modifications to this table in the civicrm_log table.
*
* @var boolean
*/
*/
public $data;
/**
- * class constructor
- *
- * @return civicrm_queue_item
+ * Class constructor.
*/
function __construct() {
$this->__table = 'civicrm_queue_item';
* @return array
*/
static function &fields() {
- if (!(self::$_fields)) {
- self::$_fields = array(
+ if (!isset(Civi::$statics[__CLASS__]['fields'])) {
+ Civi::$statics[__CLASS__]['fields'] = array(
'id' => array(
'name' => 'id',
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Queue ID') ,
'required' => true,
+ 'table_name' => 'civicrm_queue_item',
+ 'entity' => 'QueueItem',
+ 'bao' => 'CRM_Queue_BAO_QueueItem',
) ,
'queue_name' => array(
'name' => 'queue_name',
'required' => true,
'maxlength' => 64,
'size' => CRM_Utils_Type::BIG,
+ 'table_name' => 'civicrm_queue_item',
+ 'entity' => 'QueueItem',
+ 'bao' => 'CRM_Queue_BAO_QueueItem',
'html' => array(
'type' => 'Text',
) ,
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Order') ,
'required' => true,
+ 'table_name' => 'civicrm_queue_item',
+ 'entity' => 'QueueItem',
+ 'bao' => 'CRM_Queue_BAO_QueueItem',
'html' => array(
'type' => 'Text',
) ,
'title' => ts('Submit Time') ,
'description' => 'date on which this item was submitted to the queue',
'required' => true,
+ 'table_name' => 'civicrm_queue_item',
+ 'entity' => 'QueueItem',
+ 'bao' => 'CRM_Queue_BAO_QueueItem',
'html' => array(
'type' => 'Select Date',
) ,
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
'title' => ts('Release Time') ,
'description' => 'date on which this job becomes available; null if ASAP',
+ 'table_name' => 'civicrm_queue_item',
+ 'entity' => 'QueueItem',
+ 'bao' => 'CRM_Queue_BAO_QueueItem',
'html' => array(
'type' => 'Select Date',
) ,
'type' => CRM_Utils_Type::T_TEXT,
'title' => ts('Queue item datas') ,
'description' => 'Serialized queue',
+ 'table_name' => 'civicrm_queue_item',
+ 'entity' => 'QueueItem',
+ 'bao' => 'CRM_Queue_BAO_QueueItem',
) ,
);
+ CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
}
- return self::$_fields;
+ return Civi::$statics[__CLASS__]['fields'];
}
/**
- * Returns an array containing, for each field, the arary key used for that
- * field in self::$_fields.
+ * Return a mapping from field-name to the corresponding key (as used in fields()).
*
* @return array
+ * Array(string $name => string $uniqueName).
*/
static function &fieldKeys() {
- if (!(self::$_fieldKeys)) {
- self::$_fieldKeys = array(
- 'id' => 'id',
- 'queue_name' => 'queue_name',
- 'weight' => 'weight',
- 'submit_time' => 'submit_time',
- 'release_time' => 'release_time',
- 'data' => 'data',
- );
+ if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
+ Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
}
- return self::$_fieldKeys;
+ return Civi::$statics[__CLASS__]['fieldKeys'];
}
/**
* Returns the names of this table
* @return array
*/
static function &import($prefix = false) {
- if (!(self::$_import)) {
- self::$_import = array();
- $fields = self::fields();
- foreach($fields as $name => $field) {
- if (CRM_Utils_Array::value('import', $field)) {
- if ($prefix) {
- self::$_import['queue_item'] = & $fields[$name];
- } else {
- self::$_import[$name] = & $fields[$name];
- }
- }
- }
- }
- return self::$_import;
+ $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'queue_item', $prefix, array());
+ return $r;
}
/**
* Returns the list of fields that can be exported
* @return array
*/
static function &export($prefix = false) {
- if (!(self::$_export)) {
- self::$_export = array();
- $fields = self::fields();
- foreach($fields as $name => $field) {
- if (CRM_Utils_Array::value('export', $field)) {
- if ($prefix) {
- self::$_export['queue_item'] = & $fields[$name];
- } else {
- self::$_export[$name] = & $fields[$name];
- }
- }
- }
- }
- return self::$_export;
+ $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'queue_item', $prefix, array());
+ return $r;
}
}