*/
/**
- * Class CRM_Contact_BAO_RelationshipVortex.
+ * Class CRM_Contact_BAO_RelationshipCache.
*/
-class CRM_Contact_BAO_RelationshipVortex extends CRM_Contact_DAO_RelationshipVortex {
+class CRM_Contact_BAO_RelationshipCache extends CRM_Contact_DAO_RelationshipCache {
/**
- * The "mappings" array defines the values to put into `civicrm_relationship_vtx`
+ * The "mappings" array defines the values to put into `civicrm_relationship_cache`
* using data from `civicrm_relationship rel` and `civicrm_relationship_type reltype`.
*
* @var array
/**
* A list of of fields in `civicrm_relationship_type` which (if changed)
- * will necessitate an update to the vortex.
+ * will necessitate an update to the cache.
*
* @var array
*/
* This trigger runs whenever a "civicrm_relationship" record is inserted or updated.
*
* Goal: Ensure that every relationship record has two corresponding entries in the
- * vortex, the forward relationship (A=>B) and reverse relationship (B=>A).
+ * cache, the forward relationship (A=>B) and reverse relationship (B=>A).
*/
$triggers[] = [
'table' => 'civicrm_relationship',
];
}
- // Note: We do not need a DELETE trigger to maintain `civicrm_relationship_vtx` because it uses `<onDelete>CASCADE</onDelete>`.
+ // Note: We do not need a DELETE trigger to maintain `civicrm_relationship_cache` because it uses `<onDelete>CASCADE</onDelete>`.
$st = new \Civi\Core\SqlTrigger\StaticTriggers($triggers);
$st->onTriggerInfo($e);
}
/**
- * Read all records from civicrm_relationship and populate the vortex.
+ * Read all records from civicrm_relationship and populate the cache.
* Each ordinary relationship in `civicrm_relationship` becomes two
- * distinct records in the vortex (one for A=>B relations; and one for B=>A).
+ * distinct records in the cache (one for A=>B relations; and one for B=>A).
*
* This method is primarily written (a) for manual testing and (b) in case
* a broken DBMS, screwy import, buggy code, etc causes a corruption.
*
- * NOTE: This is closely related to FiveTwentyNine::populateRelationshipVortex(),
+ * NOTE: This is closely related to FiveTwentyNine::populateRelationshipCache(),
* except that the upgrader users pagination.
*/
public static function rebuild() {
$relUpdates = self::createInsertUpdateQueries();
- CRM_Core_DAO::executeQuery('TRUNCATE civicrm_relationship_vtx');
+ CRM_Core_DAO::executeQuery('TRUNCATE civicrm_relationship_cache');
foreach ($relUpdates as $relUpdate) {
$relUpdate->execute();
}
/**
* Prepare a list of SQL queries that map data from civicrm_relationship
- * to civicrm_relationship_vtx.
+ * to civicrm_relationship_cache.
*
* @return CRM_Utils_SQL_Select[]
* A list of SQL queries - one for each mapping.
foreach (self::$mappings as $name => $mapping) {
$queries[$name] = CRM_Utils_SQL_Select::from('civicrm_relationship rel')
->join('reltype', 'INNER JOIN civicrm_relationship_type reltype ON rel.relationship_type_id = reltype.id')
- ->syncInto('civicrm_relationship_vtx', self::$keyFields, $mapping);
+ ->syncInto('civicrm_relationship_cache', self::$keyFields, $mapping);
}
return $queries;
}
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
*
- * Generated from xml/schema/CRM/Contact/RelationshipVortex.xml
+ * Generated from xml/schema/CRM/Contact/RelationshipCache.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:01ed7a8f57a4438462decea08a76138a)
+ * (GenCodeChecksum:082fd4d2b313bc1928f56da80a620582)
*/
/**
- * Database access object for the RelationshipVortex entity.
+ * Database access object for the RelationshipCache entity.
*/
-class CRM_Contact_DAO_RelationshipVortex extends CRM_Core_DAO {
+class CRM_Contact_DAO_RelationshipCache extends CRM_Core_DAO {
/**
* Static instance to hold the table name.
*
* @var string
*/
- public static $_tableName = 'civicrm_relationship_vtx';
+ public static $_tableName = 'civicrm_relationship_cache';
/**
* Icon associated with this entity.
public static $_log = FALSE;
/**
- * Relationship Vortex ID
+ * Relationship Cache ID
*
* @var int
*/
public $relationship_type_id;
/**
- * The vortex record is a permutation of the original relationship record. The orientation indicates whether it is forward (a_b) or reverse (b_a) relationship.
+ * The cache record is a permutation of the original relationship record. The orientation indicates whether it is forward (a_b) or reverse (b_a) relationship.
*
* @var string
*/
* Class constructor.
*/
public function __construct() {
- $this->__table = 'civicrm_relationship_vtx';
+ $this->__table = 'civicrm_relationship_cache';
parent::__construct();
}
* Returns localized title of this entity.
*/
public static function getEntityTitle() {
- return ts('Relationship Vortexes');
+ return ts('Relationship Caches');
}
/**
'id' => [
'name' => 'id',
'type' => CRM_Utils_Type::T_INT,
- 'title' => ts('Relationship Vortex ID'),
- 'description' => ts('Relationship Vortex ID'),
+ 'title' => ts('Relationship Cache ID'),
+ 'description' => ts('Relationship Cache ID'),
'required' => TRUE,
- 'where' => 'civicrm_relationship_vtx.id',
- 'table_name' => 'civicrm_relationship_vtx',
- 'entity' => 'RelationshipVortex',
- 'bao' => 'CRM_Contact_BAO_RelationshipVortex',
+ 'where' => 'civicrm_relationship_cache.id',
+ 'table_name' => 'civicrm_relationship_cache',
+ 'entity' => 'RelationshipCache',
+ 'bao' => 'CRM_Contact_BAO_RelationshipCache',
'localizable' => 0,
'add' => '5.29',
],
'title' => ts('Relationship'),
'description' => ts('id of the relationship (FK to civicrm_relationship.id)'),
'required' => TRUE,
- 'where' => 'civicrm_relationship_vtx.relationship_id',
- 'table_name' => 'civicrm_relationship_vtx',
- 'entity' => 'RelationshipVortex',
- 'bao' => 'CRM_Contact_BAO_RelationshipVortex',
+ 'where' => 'civicrm_relationship_cache.relationship_id',
+ 'table_name' => 'civicrm_relationship_cache',
+ 'entity' => 'RelationshipCache',
+ 'bao' => 'CRM_Contact_BAO_RelationshipCache',
'localizable' => 0,
'FKClassName' => 'CRM_Contact_DAO_Relationship',
'add' => '5.29',
'title' => ts('Relationship Type'),
'description' => ts('id of the relationship type'),
'required' => TRUE,
- 'where' => 'civicrm_relationship_vtx.relationship_type_id',
- 'table_name' => 'civicrm_relationship_vtx',
- 'entity' => 'RelationshipVortex',
- 'bao' => 'CRM_Contact_BAO_RelationshipVortex',
+ 'where' => 'civicrm_relationship_cache.relationship_type_id',
+ 'table_name' => 'civicrm_relationship_cache',
+ 'entity' => 'RelationshipCache',
+ 'bao' => 'CRM_Contact_BAO_RelationshipCache',
'localizable' => 0,
'FKClassName' => 'CRM_Contact_DAO_RelationshipType',
'add' => '5.29',
'name' => 'orientation',
'type' => CRM_Utils_Type::T_STRING,
'title' => ts('Orientation (a_b or b_a)'),
- 'description' => ts('The vortex record is a permutation of the original relationship record. The orientation indicates whether it is forward (a_b) or reverse (b_a) relationship.'),
+ 'description' => ts('The cache record is a permutation of the original relationship record. The orientation indicates whether it is forward (a_b) or reverse (b_a) relationship.'),
'required' => TRUE,
'maxlength' => 3,
'size' => CRM_Utils_Type::FOUR,
- 'where' => 'civicrm_relationship_vtx.orientation',
- 'table_name' => 'civicrm_relationship_vtx',
- 'entity' => 'RelationshipVortex',
- 'bao' => 'CRM_Contact_BAO_RelationshipVortex',
+ 'where' => 'civicrm_relationship_cache.orientation',
+ 'table_name' => 'civicrm_relationship_cache',
+ 'entity' => 'RelationshipCache',
+ 'bao' => 'CRM_Contact_BAO_RelationshipCache',
'localizable' => 0,
'add' => '5.29',
],
'title' => ts('Contact ID (Near side)'),
'description' => ts('id of the first contact'),
'required' => TRUE,
- 'where' => 'civicrm_relationship_vtx.near_contact_id',
- 'table_name' => 'civicrm_relationship_vtx',
- 'entity' => 'RelationshipVortex',
- 'bao' => 'CRM_Contact_BAO_RelationshipVortex',
+ 'where' => 'civicrm_relationship_cache.near_contact_id',
+ 'table_name' => 'civicrm_relationship_cache',
+ 'entity' => 'RelationshipCache',
+ 'bao' => 'CRM_Contact_BAO_RelationshipCache',
'localizable' => 0,
'FKClassName' => 'CRM_Contact_DAO_Contact',
'add' => '5.29',
'description' => ts('name for relationship of near_contact to far_contact.'),
'maxlength' => 64,
'size' => CRM_Utils_Type::BIG,
- 'where' => 'civicrm_relationship_vtx.near_relation',
- 'table_name' => 'civicrm_relationship_vtx',
- 'entity' => 'RelationshipVortex',
- 'bao' => 'CRM_Contact_BAO_RelationshipVortex',
+ 'where' => 'civicrm_relationship_cache.near_relation',
+ 'table_name' => 'civicrm_relationship_cache',
+ 'entity' => 'RelationshipCache',
+ 'bao' => 'CRM_Contact_BAO_RelationshipCache',
'localizable' => 0,
'add' => '5.29',
],
'title' => ts('Contact ID (Far side)'),
'description' => ts('id of the second contact'),
'required' => TRUE,
- 'where' => 'civicrm_relationship_vtx.far_contact_id',
- 'table_name' => 'civicrm_relationship_vtx',
- 'entity' => 'RelationshipVortex',
- 'bao' => 'CRM_Contact_BAO_RelationshipVortex',
+ 'where' => 'civicrm_relationship_cache.far_contact_id',
+ 'table_name' => 'civicrm_relationship_cache',
+ 'entity' => 'RelationshipCache',
+ 'bao' => 'CRM_Contact_BAO_RelationshipCache',
'localizable' => 0,
'FKClassName' => 'CRM_Contact_DAO_Contact',
'html' => [
'description' => ts('name for relationship of far_contact to near_contact.'),
'maxlength' => 64,
'size' => CRM_Utils_Type::BIG,
- 'where' => 'civicrm_relationship_vtx.far_relation',
- 'table_name' => 'civicrm_relationship_vtx',
- 'entity' => 'RelationshipVortex',
- 'bao' => 'CRM_Contact_BAO_RelationshipVortex',
+ 'where' => 'civicrm_relationship_cache.far_relation',
+ 'table_name' => 'civicrm_relationship_cache',
+ 'entity' => 'RelationshipCache',
+ 'bao' => 'CRM_Contact_BAO_RelationshipCache',
'localizable' => 0,
'add' => '5.29',
],
'type' => CRM_Utils_Type::T_BOOLEAN,
'title' => ts('Relationship Is Active'),
'description' => ts('is the relationship active ?'),
- 'where' => 'civicrm_relationship_vtx.is_active',
+ 'where' => 'civicrm_relationship_cache.is_active',
'default' => '1',
- 'table_name' => 'civicrm_relationship_vtx',
- 'entity' => 'RelationshipVortex',
- 'bao' => 'CRM_Contact_BAO_RelationshipVortex',
+ 'table_name' => 'civicrm_relationship_cache',
+ 'entity' => 'RelationshipCache',
+ 'bao' => 'CRM_Contact_BAO_RelationshipCache',
'localizable' => 0,
'html' => [
'type' => 'CheckBox',
'type' => CRM_Utils_Type::T_DATE,
'title' => ts('Relationship Start Date'),
'description' => ts('date when the relationship started'),
- 'where' => 'civicrm_relationship_vtx.start_date',
- 'table_name' => 'civicrm_relationship_vtx',
- 'entity' => 'RelationshipVortex',
- 'bao' => 'CRM_Contact_BAO_RelationshipVortex',
+ 'where' => 'civicrm_relationship_cache.start_date',
+ 'table_name' => 'civicrm_relationship_cache',
+ 'entity' => 'RelationshipCache',
+ 'bao' => 'CRM_Contact_BAO_RelationshipCache',
'localizable' => 0,
'html' => [
'type' => 'Select Date',
'type' => CRM_Utils_Type::T_DATE,
'title' => ts('Relationship End Date'),
'description' => ts('date when the relationship ended'),
- 'where' => 'civicrm_relationship_vtx.end_date',
- 'table_name' => 'civicrm_relationship_vtx',
- 'entity' => 'RelationshipVortex',
- 'bao' => 'CRM_Contact_BAO_RelationshipVortex',
+ 'where' => 'civicrm_relationship_cache.end_date',
+ 'table_name' => 'civicrm_relationship_cache',
+ 'entity' => 'RelationshipCache',
+ 'bao' => 'CRM_Contact_BAO_RelationshipCache',
'localizable' => 0,
'html' => [
'type' => 'Select Date',
'type' => CRM_Utils_Type::T_INT,
'title' => ts('Relationship Case'),
'description' => ts('FK to civicrm_case'),
- 'where' => 'civicrm_relationship_vtx.case_id',
+ 'where' => 'civicrm_relationship_cache.case_id',
'default' => 'NULL',
- 'table_name' => 'civicrm_relationship_vtx',
- 'entity' => 'RelationshipVortex',
- 'bao' => 'CRM_Contact_BAO_RelationshipVortex',
+ 'table_name' => 'civicrm_relationship_cache',
+ 'entity' => 'RelationshipCache',
+ 'bao' => 'CRM_Contact_BAO_RelationshipCache',
'localizable' => 0,
'FKClassName' => 'CRM_Case_DAO_Case',
'add' => '5.29',
* @return array
*/
public static function &import($prefix = FALSE) {
- $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'relationship_vtx', $prefix, []);
+ $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'relationship_cache', $prefix, []);
return $r;
}
* @return array
*/
public static function &export($prefix = FALSE) {
- $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'relationship_vtx', $prefix, []);
+ $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'relationship_cache', $prefix, []);
return $r;
}
],
'localizable' => FALSE,
'unique' => TRUE,
- 'sig' => 'civicrm_relationship_vtx::1::relationship_id::orientation',
+ 'sig' => 'civicrm_relationship_cache::1::relationship_id::orientation',
],
'index_nearid_nearrelation' => [
'name' => 'index_nearid_nearrelation',
1 => 'near_relation',
],
'localizable' => FALSE,
- 'sig' => 'civicrm_relationship_vtx::0::near_contact_id::near_relation',
+ 'sig' => 'civicrm_relationship_cache::0::near_contact_id::near_relation',
],
'index_nearid_farrelation' => [
'name' => 'index_nearid_farrelation',
1 => 'far_relation',
],
'localizable' => FALSE,
- 'sig' => 'civicrm_relationship_vtx::0::near_contact_id::far_relation',
+ 'sig' => 'civicrm_relationship_cache::0::near_contact_id::far_relation',
],
'index_near_relation' => [
'name' => 'index_near_relation',
0 => 'near_relation',
],
'localizable' => FALSE,
- 'sig' => 'civicrm_relationship_vtx::0::near_relation',
+ 'sig' => 'civicrm_relationship_cache::0::near_relation',
],
];
return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;