Functions

Get first element of an array

first(array<mixed,mixed> $array, mixed $valueIfEmpty = NULL) : mixed
  • PHP have the reset() method which do pretty the same thing, but we have to use a variable reference as parameter so we cannot use an expression without a WARNING.
  • "reset" is also not a great name for just retrieve the first element of an array.
  • the FALSE return if array is empty is also weird. NULL by default is more logical.
package salt

Parameters

$array

array<mixed,mixed>

the array

$valueIfEmpty

mixed

(Optional, NULL) The value to return if array is empty

Returns

mixedthe first element of array or $valueIfEmpty if array empty

Get last element of an array

last(array<mixed,mixed> $array, mixed $valueIfEmpty = NULL) : mixed
  • PHP have the array_pop() method which do pretty the same thing, but we have to use a variable reference as parameter so we cannot use an expression without a WARNING.
  • "array_pop" also change the original array.
package salt

Parameters

$array

array<mixed,mixed>

the array

$valueIfEmpty

mixed

(Optional, NULL) The value to return if array is empty

Returns

mixedlast element of array or $valueIfEmpty if array empty

Classes, interfaces, and traits

Salt

SALT main class

« More »

Constants

 

Absolute path to SALT framework

PATH = \salt\Salt::saltPath() 
package salt
 

Reserved prefix for everything (field, constant, methods) in child class of SALT classes

RESERVED_PREFIX = '_salt' 
package salt
 

Last SALT release version

VERSION = '1.1.1' 
package salt

Constants

 

Default precision of Benchmark timers

BENCH_PRECISION = 5 
package salt\conf
 

Default charset

CHARSET = 'UTF-8' 
package salt\conf
 

Default PHP date format for display a date field

DEFAULT_DATE_DISPLAY_FORMAT = 'd/m/Y' 
package salt\conf
 

Launch I18n locales check

I18N_CHECK = FALSE 
package salt\conf
 

Default locale for ALL I18n instances

I18N_DEFAULT_LOCALE = 'en' 

We cannot allow user to overwrite it. So the only way to change it is here, and it changed it for all applications linked to this SALT installation.
If we allow overwrite in each application, and if two applications use different value, classes generated for SALT framework will became unconsistent :
the I18N_DEFAULT_LOCALE set the parent class of all generated classes, so we cannot have a class A with parent B for an application, and class B with parent A for another.

package salt\conf
 

Launch I18n class regeneration

I18N_GENERATE = FALSE 
package salt\conf
 

Locale for SALT I18n instance

I18N_LOCALE = 'en' 
package salt\conf
 

Mode for SALT I18n instance class generation

I18N_MODE = \salt\I18n::MODE_REGENERATE_ON_THE_FLY 
package salt\conf

Classes, interfaces, and traits

Converter

Convert object values

« More »

AbstractConverter

Convert object values

« More »

B64Converter

Convert value to base64

« More »

DAOConverter

Convert DAO value for HTML display

« More »

HTMLConverter

Escape value for HTML usage

« More »

RAWConverter

Return value without convert it

« More »

URLConverter

Escape value for URL

« More »

Classes, interfaces, and traits

Base

Base class for all business DAO objects

« More »

Dual

DAO for dual SQL table

« More »

Field

Represent a field of a DAO object / Database column

« More »

FieldType

List of Field type

« More »

Identifiable

Unique Id for classes

« More »

InformationSchemaTables

DAO for information_schema.tables of mysql instances

« More »

Model

Model class for all business DAO objects

« More »

SqlDateFormat

Predefined SQL date store format

« More »

Classes, interfaces, and traits

ClauseType

List of Clause type (for register binds by source clauses)

« More »

DBConnexion

Registered database

« More »

DBException

Exception from a query

« More »

DBHelper

Helper for execute queries

« More »

DBResult

Result of a DB query

« More »

DatabaseHelper

Helper for Database operations

« More »

RowCountException

An exception thrown when a query don't return the expected rows number

« More »

SqlBindField

Handling Fields and Binds for Query and SqlExpr

« More »

SqlExpr

Construct a complex SQL expression

« More »

SqlStatement

A child of PDOStatement with some extra methods

« More »

Classes, interfaces, and traits

BaseQuery

Base class for all queries

« More »

CountQuery

Internal query for execution only

« More »

CreateTableQuery

Query for CREATE TABLE

« More »

DeleteQuery

Query for DELETE

« More »

InsertQuery

Query for INSERT

« More »

Query

SELECT Query

« More »

UpdateQuery

Query for UPDATE

« More »

Classes, interfaces, and traits

Benchmark

Register and return times, count and data elements

« More »

I18n

Handle message translation

« More »

In

Input and Output variables - Require PHP 5.3.0

« More »

SaltException

Exception of SALT Framework

« More »

Classes, interfaces, and traits

FormHelper

HTML Form tag generation

« More »

ViewControl

Choose how to display the current page

« More »