Public Member Functions | |
__construct (Db $zdb, int|ArrayObject $args=null) | |
installInit () | |
getList () | |
getCompleteList () | |
get (int $id) | |
getLabel (int $id, bool $translated=true) | |
getIdByLabel (string $label) | |
add (string $label, int $extra) | |
update (int $id, string $label, int $extra) | |
delete (int $id) | |
isUsed (int $id) | |
__get (string $name) | |
__isset (string $name) | |
getErrors () | |
Public Attributes | |
const | DEFAULT_STATUS = 9 |
const | TABLE = 'statuts' |
const | PK = 'id_statut' |
const | ID_NOT_EXITS = -1 |
const | ID_NOT_EXISTS = -1 |
Static Protected Attributes | |
static array | $defaults |
Members status
Galette\Entity\Status::__construct | ( | Db | $zdb, |
int|ArrayObject | $args = null |
||
) |
Default constructor
Db | $zdb | Database |
int|ArrayObject<string,int|string>|null | $args Optional existing result set |
Galette\Entity\Status::__get | ( | string | $name | ) |
Global getter method
string | $name | name of the property we want to retrieve |
Galette\Entity\Status::__isset | ( | string | $name | ) |
Global isset method Required for twig to access properties via __get
string | $name | name of the property we want to retrieve |
Galette\Entity\Status::add | ( | string | $label, |
int | $extra | ||
) |
Add a new entry
string | $label | The label |
integer | $extra | Extra values (priority for statuses, extension for contributions types, ...) |
Galette\Entity\Status::delete | ( | int | $id | ) |
Delete entry
integer | $id | Entry ID |
Galette\Entity\Status::get | ( | int | $id | ) |
Get an entry
integer | $id | Entry ID |
Galette\Entity\Status::getCompleteList | ( | ) |
Complete list
Galette\Entity\Status::getErrors | ( | ) |
Get errors
Galette\Entity\Status::getIdByLabel | ( | string | $label | ) |
Get an ID from a label
string | $label | The label |
Galette\Entity\Status::getLabel | ( | int | $id, |
bool | $translated = true |
||
) |
Get a label
integer | $id | Id |
boolean | $translated | Do we want translated or original label? Defaults to true. |
Galette\Entity\Status::getList | ( | ) |
Get list in an array built as: $array[id] = "translated label"
Galette\Entity\Status::installInit | ( | ) |
Set defaults at install time
Throwable |
Galette\Entity\Status::isUsed | ( | int | $id | ) |
Check if this entry is used.
integer | $id | Entry ID |
Galette\Entity\Status::update | ( | int | $id, |
string | $label, | ||
int | $extra | ||
) |
Update in database.
integer | $id | Entry ID |
string | $label | The label |
integer | $extra | Extra values (priority for statuses, extension for contributions types, ...) |
|
staticprotected |