|
const | TABLE = 'cotisations' |
|
const | PK = 'id_cotis' |
|
const | TYPE_FEE = 'fee' |
|
const | TYPE_DONATION = 'donation' |
|
const | STATUS_NEVER = -1 |
|
const | STATUS_UNKNOWN = 0 |
|
const | STATUS_UPTODATE = 1 |
|
const | STATUS_DUEFREE = 2 |
|
const | STATUS_IMPENDING = 3 |
|
const | STATUS_LATE = 4 |
|
const | STATUS_OLD = 5 |
|
|
__isset as | trait___isset |
|
array | $errors = [] |
|
array | $forbidden_fields = ['is_cotis'] |
|
array | $virtual_fields |
|
◆ __construct()
Galette\Entity\Contribution::__construct |
( |
Db |
$zdb, |
|
|
Login |
$login, |
|
|
int|array|ArrayObject |
$args = null |
|
) |
| |
Default constructor
- Parameters
-
Db | $zdb | Database |
Login | $login | Login instance |
| null|int|array<string,mixed>|ArrayObject<string,int|string> | $args Either a ResultSet row to load a specific contribution, or a type id to just instantiate object |
◆ __get()
Galette\Entity\Contribution::__get |
( |
string |
$name | ) |
|
Global getter method
- Parameters
-
string | $name | name of the property we want to retrieve |
- Returns
- mixed the called property
◆ __set()
Galette\Entity\Contribution::__set |
( |
string |
$name, |
|
|
mixed |
$value |
|
) |
| |
Global setter method
- Parameters
-
string | $name | name of the property we want to assign a value to |
mixed | $value | a relevant value for the property |
- Returns
- void
◆ canShow()
Galette\Entity\Contribution::canShow |
( |
Login |
$login | ) |
|
Can current logged-in user display contribution
- Parameters
-
Login | $login | Login instance |
- Returns
- boolean
◆ check()
Galette\Entity\Contribution::check |
( |
array |
$values, |
|
|
array |
$required, |
|
|
array |
$disabled |
|
) |
| |
Check posted values validity
- Parameters
-
array<string,mixed> | $values All values to check, basically the $_POST array after sending the form |
array<string,int> | $required Array of required fields |
array<string> | $disabled Array of disabled fields |
- Returns
- true|array<string>
◆ checkOverlap()
Galette\Entity\Contribution::checkOverlap |
( |
| ) |
|
Check that membership fees does not overlap
- Returns
- boolean|string True if all is ok, false if error, error message if overlap
◆ executePostScript()
Galette\Entity\Contribution::executePostScript |
( |
ExternalScript |
$es, |
|
|
array |
$extra = null , |
|
|
array |
$pextra = null |
|
) |
| |
Execute post contribution script
- Parameters
-
ExternalScript | $es | External script to execute |
| ?array<string,mixed> | $extra Extra information on contribution Defaults to null |
| ?array<string,mixed> | $pextra Extra information on payment Defaults to null |
- Returns
- string|bool Script return value on success, values and script output on fail
◆ getDbFields()
static Galette\Entity\Contribution::getDbFields |
( |
Db |
$zdb | ) |
|
|
static |
Retrieve fields from database
- Parameters
-
- Returns
- array<string>
◆ getDueDate()
static Galette\Entity\Contribution::getDueDate |
( |
Db |
$zdb, |
|
|
?int |
$member_id |
|
) |
| |
|
static |
Retrieve member due date
- Parameters
-
Db | $zdb | Database instance |
| ?integer | $member_id Member identifier |
- Returns
- string|null
◆ getEventsPrefix()
Galette\Entity\Contribution::getEventsPrefix |
( |
| ) |
|
|
protected |
Get prefix for events
- Returns
- string
◆ getFieldLabel()
Galette\Entity\Contribution::getFieldLabel |
( |
string |
$field, |
|
|
string |
$entry = 'label' |
|
) |
| |
Get field label
- Parameters
-
string | $field | Field name |
string | $entry | Array entry to use (defaults to "label") |
- Returns
- string
◆ getPaymentType()
Galette\Entity\Contribution::getPaymentType |
( |
| ) |
|
Get payment type label
- Returns
- string
◆ getRawType()
Galette\Entity\Contribution::getRawType |
( |
| ) |
|
Get raw contribution type
- Returns
- string
◆ getRequired()
Galette\Entity\Contribution::getRequired |
( |
| ) |
|
Get required fields list
- Returns
- array<string, int>
◆ getRowClass()
Galette\Entity\Contribution::getRowClass |
( |
| ) |
|
Get the relevant CSS class for current contribution
- Returns
- string current contribution row class
◆ getTypeLabel()
Galette\Entity\Contribution::getTypeLabel |
( |
| ) |
|
Get contribution type label
- Returns
- string
◆ handleFiles()
Galette\Entity\Contribution::handleFiles |
( |
array |
$files | ) |
|
Handle files (dynamics files)
- Parameters
-
array<string,mixed> | $files Files sent |
- Returns
- array<string>|true
◆ hasSchedule()
Galette\Entity\Contribution::hasSchedule |
( |
| ) |
|
Does contribution have attached scheduled payment?
- Returns
- bool
- Exceptions
-
◆ isFee()
Galette\Entity\Contribution::isFee |
( |
| ) |
|
Is current contribution a membership fee
- Returns
- boolean
◆ isScheduleFullyAllocated()
Galette\Entity\Contribution::isScheduleFullyAllocated |
( |
| ) |
|
Is schedule fully allocated
- Returns
- bool
- Exceptions
-
◆ isTransactionPart()
Galette\Entity\Contribution::isTransactionPart |
( |
| ) |
|
Is current contribution part of transaction
- Returns
- boolean
◆ isTransactionPartOf()
Galette\Entity\Contribution::isTransactionPartOf |
( |
int |
$id | ) |
|
Is current contribution part of specified transaction
- Parameters
-
- Returns
- boolean
◆ load()
Galette\Entity\Contribution::load |
( |
int |
$id | ) |
|
Loads a contribution from its id
- Parameters
-
int | $id | the identifier for the contribution to load |
- Returns
- bool true if query succeed, false otherwise
◆ remove()
Galette\Entity\Contribution::remove |
( |
bool |
$transaction = true | ) |
|
Remove contribution from database
- Parameters
-
boolean | $transaction | Activate transaction mode (defaults to true) |
- Returns
- boolean
◆ sendEMail()
Galette\Entity\Contribution::sendEMail |
( |
| ) |
|
Should we send administrative emails to member?
- Returns
- boolean
◆ setContributionType()
Galette\Entity\Contribution::setContributionType |
( |
int |
$type | ) |
|
Set contribution type and determine if it is a contribution or a donation
- Parameters
-
- Returns
- self
◆ setFields()
Galette\Entity\Contribution::setFields |
( |
| ) |
|
|
protected |
Set fields, must populate $this->fields
- Returns
- self
◆ setPaymentType()
Galette\Entity\Contribution::setPaymentType |
( |
int |
$value | ) |
|
Set (and check) payment type
- Parameters
-
int | $value | Payment type to set |
- Returns
- void
- Exceptions
-
◆ setSendmail()
Galette\Entity\Contribution::setSendmail |
( |
bool |
$send = true | ) |
|
Flag creation mail sending
- Parameters
-
boolean | $send | True (default) to send creation email |
- Returns
- self
◆ setTransactionPart()
static Galette\Entity\Contribution::setTransactionPart |
( |
Db |
$zdb, |
|
|
int |
$trans_id, |
|
|
int |
$contrib_id |
|
) |
| |
|
static |
Set a contribution as a transaction part
- Parameters
-
- Returns
- boolean
◆ store()
Galette\Entity\Contribution::store |
( |
| ) |
|
Store the contribution
- Returns
- boolean
◆ unsetTransactionPart()
static Galette\Entity\Contribution::unsetTransactionPart |
( |
Db |
$zdb, |
|
|
Login |
$login, |
|
|
int |
$trans_id, |
|
|
int |
$contrib_id |
|
) |
| |
|
static |
Detach a contribution from a transaction
- Parameters
-
Db | $zdb | Database instance |
Login | $login | Login instance |
int | $trans_id | Transaction identifier |
int | $contrib_id | Contribution identifier |
- Returns
- boolean
◆ $virtual_fields
array Galette\Entity\Contribution::$virtual_fields |
|
protected |
Initial value:= [
'duration',
'model',
'raw_date',
'raw_begin_date',
'raw_end_date',
]
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/galette-apidoc/checkouts/develop/galette/lib/Galette/Entity/Contribution.php