__table = 'civicrm_uf_group'; parent::__construct(); } /** * Returns foreign keys and entity references. * * @return array * [CRM_Core_Reference_Interface] */ public static function getReferenceColumns() { if (!isset(Civi::$statics[__CLASS__]['links'])) { Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'limit_listings_group_id', 'civicrm_group', 'id'); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'add_to_group_id', 'civicrm_group', 'id'); Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id'); CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); } return Civi::$statics[__CLASS__]['links']; } /** * 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' => ts('Profile ID'), 'description' => ts('Unique table ID'), 'required' => TRUE, 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'is_active' => [ 'name' => 'is_active', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Profile Is Active'), 'description' => ts('Is this form currently active? If false, hide all related fields for all sharing contexts.'), 'default' => '1', 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'group_type' => [ 'name' => 'group_type', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Profile Group Type'), 'description' => ts('Comma separated list of the type(s) of profile fields.'), 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'import' => TRUE, 'where' => 'civicrm_uf_group.group_type', 'headerPattern' => '', 'dataPattern' => '', 'export' => TRUE, 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, 'serialize' => self::SERIALIZE_COMMA, ], 'title' => [ 'name' => 'title', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Profile Name'), 'description' => ts('Form title.'), 'required' => TRUE, 'maxlength' => 64, 'size' => CRM_Utils_Type::BIG, 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 1, 'html' => [ 'type' => 'Text', ], ], 'frontend_title' => [ 'name' => 'frontend_title', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Public Title'), 'description' => ts('Profile Form Public title'), 'maxlength' => 64, 'size' => CRM_Utils_Type::BIG, 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 1, 'html' => [ 'type' => 'Text', ], ], 'description' => [ 'name' => 'description', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Profile Description'), 'description' => ts('Optional verbose description of the profile.'), 'rows' => 2, 'cols' => 60, 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, 'html' => [ 'type' => 'TextArea', ], ], 'help_pre' => [ 'name' => 'help_pre', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Help Pre'), 'description' => ts('Description and/or help text to display before fields in form.'), 'rows' => 4, 'cols' => 80, 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 1, 'html' => [ 'type' => 'TextArea', ], ], 'help_post' => [ 'name' => 'help_post', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Profile Post Text'), 'description' => ts('Description and/or help text to display after fields in form.'), 'rows' => 4, 'cols' => 80, 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 1, 'html' => [ 'type' => 'TextArea', ], ], 'limit_listings_group_id' => [ 'name' => 'limit_listings_group_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Profile Search Limit Group'), 'description' => ts('Group id, foreign key from civicrm_group'), 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, 'FKClassName' => 'CRM_Contact_DAO_Group', ], 'post_URL' => [ 'name' => 'post_URL', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Post Url'), 'description' => ts('Redirect to URL.'), 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'add_to_group_id' => [ 'name' => 'add_to_group_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Add Contact To Group'), 'description' => ts('foreign key to civicrm_group_id'), 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, 'FKClassName' => 'CRM_Contact_DAO_Group', ], 'add_captcha' => [ 'name' => 'add_captcha', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Show Captcha On Profile'), 'description' => ts('Should a CAPTCHA widget be included this Profile form.'), 'default' => '0', 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'is_map' => [ 'name' => 'is_map', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Map Profile'), 'description' => ts('Do we want to map results from this profile.'), 'default' => '0', 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'is_edit_link' => [ 'name' => 'is_edit_link', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Show Edit Link?'), 'description' => ts('Should edit link display in profile selector'), 'default' => '0', 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'is_uf_link' => [ 'name' => 'is_uf_link', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Show Link to CMS User'), 'description' => ts('Should we display a link to the website profile in profile selector'), 'default' => '0', 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'is_update_dupe' => [ 'name' => 'is_update_dupe', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Update on Duplicate'), 'description' => ts('Should we update the contact record if we find a duplicate'), 'default' => '0', 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'cancel_URL' => [ 'name' => 'cancel_URL', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Profile Cancel URL'), 'description' => ts('Redirect to URL when Cancle button clik .'), 'maxlength' => 255, 'size' => CRM_Utils_Type::HUGE, 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'is_cms_user' => [ 'name' => 'is_cms_user', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Create CMS User?'), 'description' => ts('Should we create a cms user for this profile '), 'default' => '0', 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'notify' => [ 'name' => 'notify', 'type' => CRM_Utils_Type::T_TEXT, 'title' => ts('Notify on Profile Submit'), 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'is_reserved' => [ 'name' => 'is_reserved', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Profile Is Reserved'), 'description' => ts('Is this group reserved for use by some other CiviCRM functionality?'), 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'name' => [ 'name' => 'name', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Profile Name'), 'description' => ts('Name of the UF group for directly addressing it in the codebase'), 'maxlength' => 64, 'size' => CRM_Utils_Type::BIG, 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'created_id' => [ 'name' => 'created_id', 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Profile Created By'), 'description' => ts('FK to civicrm_contact, who created this UF group'), 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, 'FKClassName' => 'CRM_Contact_DAO_Contact', ], 'created_date' => [ 'name' => 'created_date', 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, 'title' => ts('UF Group Created Date'), 'description' => ts('Date and time this UF group was created.'), 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'is_proximity_search' => [ 'name' => 'is_proximity_search', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Include Proximity Search?'), 'description' => ts('Should we include proximity search feature in this profile search form?'), 'default' => '0', 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], 'cancel_button_text' => [ 'name' => 'cancel_button_text', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Cancel Button Text'), 'description' => ts('Custom Text to display on the Cancel button when used in create or edit mode'), 'maxlength' => 64, 'size' => CRM_Utils_Type::BIG, 'default' => 'NULL', 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 1, ], 'submit_button_text' => [ 'name' => 'submit_button_text', 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Submit Button Text'), 'description' => ts('Custom Text to display on the submit button on profile edit/create screens'), 'maxlength' => 64, 'size' => CRM_Utils_Type::BIG, 'default' => 'NULL', 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 1, ], 'add_cancel_button' => [ 'name' => 'add_cancel_button', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Include Cancel Button'), 'description' => ts('Should a Cancel button be included in this Profile form.'), 'default' => '1', 'table_name' => 'civicrm_uf_group', 'entity' => 'UFGroup', 'bao' => 'CRM_Core_BAO_UFGroup', 'localizable' => 0, ], ]; CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); } return Civi::$statics[__CLASS__]['fields']; } /** * Return a mapping from field-name to the corresponding key (as used in fields()). * * @return array * Array(string $name => string $uniqueName). */ public static function &fieldKeys() { if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); } return Civi::$statics[__CLASS__]['fieldKeys']; } /** * Returns the names of this table * * @return string */ public static function getTableName() { return CRM_Core_DAO::getLocaleTableName(self::$_tableName); } /** * Returns if this table needs to be logged * * @return bool */ public function getLog() { return self::$_log; } /** * 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__, 'uf_group', $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__, 'uf_group', $prefix, []); return $r; } /** * Returns the list of indices * * @param bool $localize * * @return array */ public static function indices($localize = TRUE) { $indices = [ 'UI_name' => [ 'name' => 'UI_name', 'field' => [ 0 => 'name', ], 'localizable' => FALSE, 'unique' => TRUE, 'sig' => 'civicrm_uf_group::1::name', ], ]; return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; } }