/** * Build a list of triggers via hook and add them to (err, reconcile them * with) the database. * * @param string $tableName * the specific table requiring a rebuild; or NULL to rebuild all tables. * @param bool $force * * @see CRM-9716 */ public function rebuild($tableName = NULL, $force = FALSE) { $info = array(); $logging = new \CRM_Logging_Schema(); $logging->triggerInfo($info, $tableName, $force); \CRM_Core_I18n_Schema::triggerInfo($info, $tableName); \CRM_Contact_BAO_Contact::triggerInfo($info, $tableName); \CRM_Utils_Hook::triggerInfo($info, $tableName); // drop all existing triggers on all tables $logging->dropTriggers($tableName); // now create the set of new triggers $this->createTriggers($info, $tableName); }
static function triggerRebuild($tableName = NULL) { $info = array(); $logging = new CRM_Logging_Schema(); $logging->triggerInfo($info, $tableName); CRM_Core_I18n_Schema::triggerInfo($info, $tableName); CRM_Utils_Hook::triggerInfo($info, $tableName); // drop all existing triggers on all tables $logging->dropTriggers($tableName); // now create the set of new triggers self::createTriggers($info); }