Galette API documentation
Gestionnaire d’Adhérents en Ligne Extrêmement Tarabiscoté mais Tellement Efficace
1.0.0
Galette\Entity\Transaction Class Reference

Public Member Functions

 __construct (Db $zdb, Login $login, ArrayObject|int|null $args=null)
 
 remove (History $hist, bool $transaction=true)
 
 check (array $values, array $required, array $disabled)
 
 store (History $hist)
 
 getDispatchedAmount ()
 
 getMissingAmount ()
 
 getPaymentType ()
 
 getDbFields (Db $zdb)
 
 getRowClass ()
 
 __get (string $name)
 
 handleFiles (array $files)
 
 canShow (Login $login)
 

Public Attributes

const TABLE = 'transactions'
 
const PK = 'trans_id'
 

Protected Member Functions

 setFields ()
 

Protected Attributes

array $errors
 
array $forbidden_fields = []
 

Constructor & Destructor Documentation

◆ __construct()

Galette\Entity\Transaction::__construct ( Db  $zdb,
Login  $login,
ArrayObject|int|null  $args = null 
)

Default constructor

Parameters
Db$zdbDatabase instance
Login$loginLogin instance
null|int|ArrayObject<string,int|string>$args Either a ResultSet row or its id for to load a specific transaction, or null to just instantiate object

Member Function Documentation

◆ __get()

Galette\Entity\Transaction::__get ( string  $name)

Global getter method

Parameters
string$namename of the property we want to retrieve
Returns
mixed the called property

◆ canShow()

Galette\Entity\Transaction::canShow ( Login  $login)

Can current logged-in user display transaction

Parameters
Login$loginLogin instance
Returns
boolean

◆ check()

Galette\Entity\Transaction::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>

TODO: retrieve field length from database and check that

◆ getDbFields()

Galette\Entity\Transaction::getDbFields ( Db  $zdb)

Retrieve fields from database

Parameters
Db$zdbDatabase instance
Returns
array<string>

◆ getDispatchedAmount()

Galette\Entity\Transaction::getDispatchedAmount ( )

Retrieve amount that has already been dispatched into contributions

Returns
double

◆ getMissingAmount()

Galette\Entity\Transaction::getMissingAmount ( )

Retrieve amount that has not yet been dispatched into contributions

Returns
double

◆ getPaymentType()

Galette\Entity\Transaction::getPaymentType ( )

Get payment type label

Returns
string

◆ getRowClass()

Galette\Entity\Transaction::getRowClass ( )

Get the relevant CSS class for current transaction

Returns
string current transaction row class

◆ handleFiles()

Galette\Entity\Transaction::handleFiles ( array  $files)

Handle files (dynamics files)

Parameters
array<string,mixed>$files Files sent
Returns
array<string>|true

◆ remove()

Galette\Entity\Transaction::remove ( History  $hist,
bool  $transaction = true 
)

Remove transaction (and all associated contributions) from database

Parameters
History$histHistory
boolean$transactionActivate transaction mode (defaults to true)
Returns
boolean

◆ setFields()

Galette\Entity\Transaction::setFields ( )
protected

Set fields, must populate $this->fields

Returns
self

◆ store()

Galette\Entity\Transaction::store ( History  $hist)

Store the transaction

Parameters
History$histHistory
Returns
boolean

FIXME: quote?


The documentation for this class was generated from the following file: