mirror of
https://codeberg.org/artfulrobot/contactcats.git
synced 2025-06-25 04:58:04 +02:00
239 lines
6.6 KiB
PHP
239 lines
6.6 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @package CRM
|
|
* @copyright CiviCRM LLC https://civicrm.org/licensing
|
|
*
|
|
* Generated from contactcats/xml/schema/CRM/Contactcats/ContactCategory.xml
|
|
* DO NOT EDIT. Generated by CRM_Core_CodeGen
|
|
* (GenCodeChecksum:222d053743f68a2678d92b8a75b46316)
|
|
*/
|
|
use CRM_Contactcats_ExtensionUtil as E;
|
|
|
|
/**
|
|
* Database access object for the ContactCategory entity.
|
|
*/
|
|
class CRM_Contactcats_DAO_ContactCategory extends CRM_Core_DAO {
|
|
const EXT = E::LONG_NAME;
|
|
const TABLE_ADDED = '';
|
|
|
|
/**
|
|
* Static instance to hold the table name.
|
|
*
|
|
* @var string
|
|
*/
|
|
public static $_tableName = 'civicrm_contact_category';
|
|
|
|
/**
|
|
* Should CiviCRM log any modifications to this table in the civicrm_log table.
|
|
*
|
|
* @var bool
|
|
*/
|
|
public static $_log = FALSE;
|
|
|
|
/**
|
|
* Unique ID, corresponds to contact id
|
|
*
|
|
* @var int|string|null
|
|
* (SQL type: int unsigned)
|
|
* Note that values will be retrieved from the database as a string.
|
|
*/
|
|
public $id;
|
|
|
|
/**
|
|
* Same as id but for FormBuilder
|
|
*
|
|
* @var int|string
|
|
* (SQL type: int unsigned)
|
|
* Note that values will be retrieved from the database as a string.
|
|
*/
|
|
public $contact_id;
|
|
|
|
/**
|
|
* @var int|string
|
|
* (SQL type: int unsigned)
|
|
* Note that values will be retrieved from the database as a string.
|
|
*/
|
|
public $category;
|
|
|
|
/**
|
|
* @var int|string
|
|
* (SQL type: int unsigned)
|
|
* Note that values will be retrieved from the database as a string.
|
|
*/
|
|
public $next_category;
|
|
|
|
/**
|
|
* Class constructor.
|
|
*/
|
|
public function __construct() {
|
|
$this->__table = 'civicrm_contact_category';
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* Returns localized title of this entity.
|
|
*
|
|
* @param bool $plural
|
|
* Whether to return the plural version of the title.
|
|
*/
|
|
public static function getEntityTitle($plural = FALSE) {
|
|
return $plural ? E::ts('Contact Categories') : E::ts('Contact Category');
|
|
}
|
|
|
|
/**
|
|
* Returns all the column names of this table
|
|
*
|
|
* @return array
|
|
*/
|
|
public static function &fields() {
|
|
if (!isset(Civi::$statics[__CLASS__]['fields'])) {
|
|
Civi::$statics[__CLASS__]['fields'] = [
|
|
'id' => [
|
|
'name' => 'id',
|
|
'type' => CRM_Utils_Type::T_INT,
|
|
'title' => E::ts('ID'),
|
|
'description' => E::ts('Unique ID, corresponds to contact id'),
|
|
'required' => TRUE,
|
|
'usage' => [
|
|
'import' => FALSE,
|
|
'export' => FALSE,
|
|
'duplicate_matching' => FALSE,
|
|
'token' => FALSE,
|
|
],
|
|
'where' => 'civicrm_contact_category.id',
|
|
'table_name' => 'civicrm_contact_category',
|
|
'entity' => 'ContactCategory',
|
|
'bao' => 'CRM_Contactcats_DAO_ContactCategory',
|
|
'localizable' => 0,
|
|
'html' => [
|
|
'type' => 'Number',
|
|
],
|
|
'readonly' => TRUE,
|
|
'add' => NULL,
|
|
],
|
|
'contact_id' => [
|
|
'name' => 'contact_id',
|
|
'type' => CRM_Utils_Type::T_INT,
|
|
'title' => E::ts('Contact ID'),
|
|
'description' => E::ts('Same as id but for FormBuilder'),
|
|
'required' => TRUE,
|
|
'usage' => [
|
|
'import' => FALSE,
|
|
'export' => FALSE,
|
|
'duplicate_matching' => FALSE,
|
|
'token' => FALSE,
|
|
],
|
|
'where' => 'civicrm_contact_category.contact_id',
|
|
'table_name' => 'civicrm_contact_category',
|
|
'entity' => 'ContactCategory',
|
|
'bao' => 'CRM_Contactcats_DAO_ContactCategory',
|
|
'localizable' => 0,
|
|
'FKClassName' => 'CRM_Contact_DAO_Contact',
|
|
'html' => [
|
|
'type' => 'EntityRef',
|
|
'label' => E::ts("Contact"),
|
|
],
|
|
'add' => NULL,
|
|
],
|
|
'category' => [
|
|
'name' => 'category',
|
|
'type' => CRM_Utils_Type::T_INT,
|
|
'title' => E::ts('Category'),
|
|
'required' => TRUE,
|
|
'usage' => [
|
|
'import' => FALSE,
|
|
'export' => FALSE,
|
|
'duplicate_matching' => FALSE,
|
|
'token' => FALSE,
|
|
],
|
|
'where' => 'civicrm_contact_category.category',
|
|
'default' => '0',
|
|
'table_name' => 'civicrm_contact_category',
|
|
'entity' => 'ContactCategory',
|
|
'bao' => 'CRM_Contactcats_DAO_ContactCategory',
|
|
'localizable' => 0,
|
|
'html' => [
|
|
'type' => 'Select',
|
|
],
|
|
'pseudoconstant' => [
|
|
'optionGroupName' => 'contact_categories',
|
|
'optionEditPath' => 'civicrm/admin/options/contact_categories',
|
|
],
|
|
'add' => NULL,
|
|
],
|
|
'next_category' => [
|
|
'name' => 'next_category',
|
|
'type' => CRM_Utils_Type::T_INT,
|
|
'title' => E::ts('Next Category'),
|
|
'required' => TRUE,
|
|
'usage' => [
|
|
'import' => FALSE,
|
|
'export' => FALSE,
|
|
'duplicate_matching' => FALSE,
|
|
'token' => FALSE,
|
|
],
|
|
'where' => 'civicrm_contact_category.next_category',
|
|
'default' => '0',
|
|
'table_name' => 'civicrm_contact_category',
|
|
'entity' => 'ContactCategory',
|
|
'bao' => 'CRM_Contactcats_DAO_ContactCategory',
|
|
'localizable' => 0,
|
|
'pseudoconstant' => [
|
|
'optionGroupName' => 'contact_categories',
|
|
'optionEditPath' => 'civicrm/admin/options/contact_categories',
|
|
],
|
|
'add' => NULL,
|
|
],
|
|
];
|
|
CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
|
|
}
|
|
return Civi::$statics[__CLASS__]['fields'];
|
|
}
|
|
|
|
/**
|
|
* Returns the list of fields that can be imported
|
|
*
|
|
* @param bool $prefix
|
|
*
|
|
* @return array
|
|
*/
|
|
public static function &import($prefix = FALSE) {
|
|
$r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contact_category', $prefix, []);
|
|
return $r;
|
|
}
|
|
|
|
/**
|
|
* Returns the list of fields that can be exported
|
|
*
|
|
* @param bool $prefix
|
|
*
|
|
* @return array
|
|
*/
|
|
public static function &export($prefix = FALSE) {
|
|
$r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contact_category', $prefix, []);
|
|
return $r;
|
|
}
|
|
|
|
/**
|
|
* Returns the list of indices
|
|
*
|
|
* @param bool $localize
|
|
*
|
|
* @return array
|
|
*/
|
|
public static function indices($localize = TRUE) {
|
|
$indices = [
|
|
'index_category' => [
|
|
'name' => 'index_category',
|
|
'field' => [
|
|
0 => 'category',
|
|
],
|
|
'localizable' => FALSE,
|
|
'sig' => 'civicrm_contact_category::0::category',
|
|
],
|
|
];
|
|
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
|
|
}
|
|
|
|
}
|