Skip to content

Commit

Permalink
Make Project entity_id and entity_table non-required
Browse files Browse the repository at this point in the history
  • Loading branch information
larssandergreen committed Jul 11, 2023
1 parent 14b4487 commit 975bf8c
Show file tree
Hide file tree
Showing 6 changed files with 246 additions and 36 deletions.
129 changes: 113 additions & 16 deletions CRM/Volunteer/DAO/Need.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from org.civicrm.volunteer/xml/schema/CRM/Volunteer/Need.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:f028b707d10c466685b33b7dc5a94f79)
* (GenCodeChecksum:3dbbc0ff3b491a8c56fb6003ddca4a3e)
*/
use CRM_Volunteer_ExtensionUtil as E;

Expand Down Expand Up @@ -34,78 +34,102 @@ class CRM_Volunteer_DAO_Need extends CRM_Core_DAO {
/**
* Need Id
*
* @var int
* @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/
public $id;

/**
* FK to civicrm_volunteer_project table which contains entity_table + entity for each volunteer project (initially civicrm_event + eventID).
*
* @var int
* @var int|string
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/
public $project_id;

/**
* @var datetime
* @var string|null
* (SQL type: datetime)
* Note that values will be retrieved from the database as a string.
*/
public $start_time;

/**
* Used for specifying fuzzy dates, e.g., I have a need for 3 hours of volunteer work to be completed between 12/01/2015 and 12/31/2015.
*
* @var datetime
* @var string|null
* (SQL type: datetime)
* Note that values will be retrieved from the database as a string.
*/
public $end_time;

/**
* Length in minutes of this volunteer time slot.
*
* @var int
* @var int|string|null
* (SQL type: int)
* Note that values will be retrieved from the database as a string.
*/
public $duration;

/**
* Boolean indicating whether or not the time and role are flexible. Activities linked to a flexible need indicate that the volunteer is generally available.
*
* @var bool
* @var bool|string
* (SQL type: tinyint)
* Note that values will be retrieved from the database as a string.
*/
public $is_flexible;

/**
* The number of volunteers needed for this need.
*
* @var int
* @var int|string|null
* (SQL type: int)
* Note that values will be retrieved from the database as a string.
*/
public $quantity;

/**
* Indicates whether this need is offered on public volunteer signup forms. Implicit FK to option_value row in visibility option_group.
*
* @var int
* @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/
public $visibility_id;

/**
* The role associated with this need. Implicit FK to option_value row in volunteer_role option_group.
*
* @var int
* @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/
public $role_id;

/**
* Is this need enabled?
*
* @var bool
* @var bool|string
* (SQL type: tinyint)
* Note that values will be retrieved from the database as a string.
*/
public $is_active;

/**
* @var timestamp
* @var string|null
* (SQL type: timestamp)
* Note that values will be retrieved from the database as a string.
*/
public $created;

/**
* @var timestamp
* @var string|null
* (SQL type: timestamp)
* Note that values will be retrieved from the database as a string.
*/
public $last_updated;

Expand Down Expand Up @@ -156,6 +180,12 @@ public static function &fields() {
'title' => E::ts('CiviVolunteer Need ID'),
'description' => E::ts('Need Id'),
'required' => TRUE,
'usage' => [
'import' => FALSE,
'export' => FALSE,
'duplicate_matching' => FALSE,
'token' => FALSE,
],
'where' => 'civicrm_volunteer_need.id',
'table_name' => 'civicrm_volunteer_need',
'entity' => 'Need',
Expand All @@ -167,8 +197,15 @@ public static function &fields() {
'project_id' => [
'name' => 'project_id',
'type' => CRM_Utils_Type::T_INT,
'title' => E::ts('Project ID'),
'description' => E::ts('FK to civicrm_volunteer_project table which contains entity_table + entity for each volunteer project (initially civicrm_event + eventID).'),
'required' => FALSE,
'usage' => [
'import' => FALSE,
'export' => FALSE,
'duplicate_matching' => FALSE,
'token' => FALSE,
],
'where' => 'civicrm_volunteer_need.project_id',
'table_name' => 'civicrm_volunteer_need',
'entity' => 'Need',
Expand All @@ -181,6 +218,12 @@ public static function &fields() {
'name' => 'start_time',
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
'title' => E::ts('Start Date and Time'),
'usage' => [
'import' => FALSE,
'export' => FALSE,
'duplicate_matching' => FALSE,
'token' => FALSE,
],
'where' => 'civicrm_volunteer_need.start_time',
'table_name' => 'civicrm_volunteer_need',
'entity' => 'Need',
Expand All @@ -193,6 +236,12 @@ public static function &fields() {
'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
'title' => E::ts('End Date and Time'),
'description' => E::ts('Used for specifying fuzzy dates, e.g., I have a need for 3 hours of volunteer work to be completed between 12/01/2015 and 12/31/2015.'),
'usage' => [
'import' => FALSE,
'export' => FALSE,
'duplicate_matching' => FALSE,
'token' => FALSE,
],
'where' => 'civicrm_volunteer_need.end_time',
'table_name' => 'civicrm_volunteer_need',
'entity' => 'Need',
Expand All @@ -205,6 +254,12 @@ public static function &fields() {
'type' => CRM_Utils_Type::T_INT,
'title' => E::ts('Duration'),
'description' => E::ts('Length in minutes of this volunteer time slot.'),
'usage' => [
'import' => FALSE,
'export' => FALSE,
'duplicate_matching' => FALSE,
'token' => FALSE,
],
'where' => 'civicrm_volunteer_need.duration',
'table_name' => 'civicrm_volunteer_need',
'entity' => 'Need',
Expand All @@ -218,6 +273,12 @@ public static function &fields() {
'title' => E::ts('Flexible'),
'description' => E::ts('Boolean indicating whether or not the time and role are flexible. Activities linked to a flexible need indicate that the volunteer is generally available.'),
'required' => TRUE,
'usage' => [
'import' => FALSE,
'export' => FALSE,
'duplicate_matching' => FALSE,
'token' => FALSE,
],
'where' => 'civicrm_volunteer_need.is_flexible',
'default' => '0',
'table_name' => 'civicrm_volunteer_need',
Expand All @@ -231,8 +292,14 @@ public static function &fields() {
'type' => CRM_Utils_Type::T_INT,
'title' => E::ts('Quantity'),
'description' => E::ts('The number of volunteers needed for this need.'),
'usage' => [
'import' => FALSE,
'export' => FALSE,
'duplicate_matching' => FALSE,
'token' => FALSE,
],
'where' => 'civicrm_volunteer_need.quantity',
'default' => 'NULL',
'default' => NULL,
'table_name' => 'civicrm_volunteer_need',
'entity' => 'Need',
'bao' => 'CRM_Volunteer_DAO_Need',
Expand All @@ -244,8 +311,14 @@ public static function &fields() {
'type' => CRM_Utils_Type::T_INT,
'title' => E::ts('Visibility'),
'description' => E::ts(' Indicates whether this need is offered on public volunteer signup forms. Implicit FK to option_value row in visibility option_group.'),
'usage' => [
'import' => FALSE,
'export' => FALSE,
'duplicate_matching' => FALSE,
'token' => FALSE,
],
'where' => 'civicrm_volunteer_need.visibility_id',
'default' => 'NULL',
'default' => NULL,
'table_name' => 'civicrm_volunteer_need',
'entity' => 'Need',
'bao' => 'CRM_Volunteer_DAO_Need',
Expand All @@ -261,8 +334,14 @@ public static function &fields() {
'type' => CRM_Utils_Type::T_INT,
'title' => E::ts('Role'),
'description' => E::ts('The role associated with this need. Implicit FK to option_value row in volunteer_role option_group.'),
'usage' => [
'import' => FALSE,
'export' => FALSE,
'duplicate_matching' => FALSE,
'token' => FALSE,
],
'where' => 'civicrm_volunteer_need.role_id',
'default' => 'NULL',
'default' => NULL,
'table_name' => 'civicrm_volunteer_need',
'entity' => 'Need',
'bao' => 'CRM_Volunteer_DAO_Need',
Expand All @@ -279,6 +358,12 @@ public static function &fields() {
'title' => E::ts('Enabled'),
'description' => E::ts('Is this need enabled?'),
'required' => TRUE,
'usage' => [
'import' => FALSE,
'export' => FALSE,
'duplicate_matching' => FALSE,
'token' => FALSE,
],
'where' => 'civicrm_volunteer_need.is_active',
'default' => '1',
'table_name' => 'civicrm_volunteer_need',
Expand All @@ -291,6 +376,12 @@ public static function &fields() {
'name' => 'created',
'type' => CRM_Utils_Type::T_TIMESTAMP,
'title' => E::ts('Date of Creation'),
'usage' => [
'import' => FALSE,
'export' => FALSE,
'duplicate_matching' => FALSE,
'token' => FALSE,
],
'where' => 'civicrm_volunteer_need.created',
'default' => 'CURRENT_TIMESTAMP',
'table_name' => 'civicrm_volunteer_need',
Expand All @@ -303,6 +394,12 @@ public static function &fields() {
'name' => 'last_updated',
'type' => CRM_Utils_Type::T_TIMESTAMP,
'title' => E::ts('Date of Last Update'),
'usage' => [
'import' => FALSE,
'export' => FALSE,
'duplicate_matching' => FALSE,
'token' => FALSE,
],
'where' => 'civicrm_volunteer_need.last_updated',
'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
'table_name' => 'civicrm_volunteer_need',
Expand Down
Loading

0 comments on commit 975bf8c

Please sign in to comment.