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

Public Member Functions

 __construct (Db $zdb, bool $clean=true)
 
 generateNewLink (int $target, int $id)
 
 isHashValid (string $hash, string $code)
 

Public Attributes

const TABLE = 'tmplinks'
 
const PK = 'hash'
 
const TARGET_MEMBERCARD = 1
 
const TARGET_INVOICE = 2
 
const TARGET_RECEIPT = 3
 

Protected Member Functions

 cleanExpired ()
 

Detailed Description

Temporary links for galette, to send direct links to invoices, receipts, and member cards directly by email

Author
Johan Cwiklinski johan.nosp@m.@x-t.nosp@m.nd.be

Constructor & Destructor Documentation

◆ __construct()

Galette\Core\Links::__construct ( Db  $zdb,
bool  $clean = true 
)

Default constructor

Parameters
Db$zdbDatabase instance:
boolean$cleanWhether we should clean expired links in database

Member Function Documentation

◆ cleanExpired()

Galette\Core\Links::cleanExpired ( )
protected

Remove expired links queries (older than 1 week)

Returns
boolean

◆ generateNewLink()

Galette\Core\Links::generateNewLink ( int  $target,
int  $id 
)

Generates a new link for specified target

Parameters
int$targetTarget (one of self::TARGET_* constants)
int$idTarget identifier
Returns
string

◆ isHashValid()

Galette\Core\Links::isHashValid ( string  $hash,
string  $code 
)

Check if requested hash is valid

Parameters
string$hashthe hash, base64 encoded
string$codeCode sent to validate link
Returns
array<int,int>|false false if hash is not valid, array otherwise

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