Galette API documentation
Gestionnaire d’Adhérents en Ligne Extrêmement Tarabiscoté mais Tellement Efficace
1.0.0
Galette\Core\History Class Reference
Inheritance diagram for Galette\Core\History:
Collaboration diagram for Galette\Core\History:

Public Member Functions

 __construct (Db $zdb, Login $login, Preferences $preferences, HistoryList $filters=null)
 
 add (string $action, string $argument='', string $query='')
 
 clean ()
 
 getHistory ()
 
 __get (string $name)
 
 __isset (string $name)
 
 __set (string $name, mixed $value)
 
 setFilters (HistoryList $filters)
 
 getCount ()
 
 getUsersList ()
 
 getActionsList ()
 

Static Public Member Functions

static findUserIPAddress ()
 

Public Attributes

const TABLE = 'logs'
 
const PK = 'id_log'
 

Protected Member Functions

 buildOrderClause ()
 
 getTableName (bool $prefixed=false)
 
 getPk ()
 

Protected Attributes

int $count
 
Db $zdb
 
Login $login
 
Preferences $preferences
 
HistoryList $filters
 
array $users
 
array $actions
 
bool $with_lists = true
 

Constructor & Destructor Documentation

◆ __construct()

Galette\Core\History::__construct ( Db  $zdb,
Login  $login,
Preferences  $preferences,
HistoryList  $filters = null 
)

Default constructor

Parameters
Db$zdbDatabase
Login$loginLogin
Preferences$preferencesPreferences
?HistoryList$filters Filtering

Member Function Documentation

◆ __get()

Galette\Core\History::__get ( string  $name)

Global getter method

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

◆ __isset()

Galette\Core\History::__isset ( string  $name)

Global isset method Required for twig to access properties via __get

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

◆ __set()

Galette\Core\History::__set ( string  $name,
mixed  $value 
)

Global setter method

Parameters
string$namename of the property we want to assign a value to
mixed$valuea relevant value for the property
Returns
void

◆ add()

Galette\Core\History::add ( string  $action,
string  $argument = '',
string  $query = '' 
)

Add a new entry

Parameters
string$actionthe action to log
string$argumentthe argument
string$querythe query (if relevant)
Returns
bool true if entry was successfully added, false otherwise

◆ buildOrderClause()

Galette\Core\History::buildOrderClause ( )
protected

Builds the order clause

Returns
array<int, string> SQL ORDER clauses

Reimplemented in Galette\Core\MailingHistory.

◆ clean()

Galette\Core\History::clean ( )

Delete all entries

Returns
boolean

◆ findUserIPAddress()

static Galette\Core\History::findUserIPAddress ( )
static

Helper function to find the user IP address

This function uses the client address or the appropriate part of X-Forwarded-For, if present and the configuration specifies it. (blindly trusting X-Forwarded-For would make the IP address logging very easy to deveive.

Returns
string

◆ getActionsList()

Galette\Core\History::getActionsList ( )

Get actions list

Returns
array<int, string>

◆ getCount()

Galette\Core\History::getCount ( )

Get count for current query

Returns
int

Reimplemented in Galette\Core\MailingHistory.

◆ getHistory()

Galette\Core\History::getHistory ( )

Get the entire history list

Returns
array<int, object>

Reimplemented in Galette\Core\MailingHistory.

◆ getPk()

Galette\Core\History::getPk ( )
protected

Get table's PK

Returns
string

Reimplemented in Galette\Core\MailingHistory.

◆ getTableName()

Galette\Core\History::getTableName ( bool  $prefixed = false)
protected

Get table's name

Parameters
boolean$prefixedWhether table name should be prefixed
Returns
string

Reimplemented in Galette\Core\MailingHistory.

◆ getUsersList()

Galette\Core\History::getUsersList ( )

Get users list

Returns
array<int, string>

◆ setFilters()

Galette\Core\History::setFilters ( HistoryList  $filters)

Set filters

Parameters
HistoryList$filtersFilters
Returns
self

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