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

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
 

Default locale for ALL I18n instances

I18N_DEFAULT_LOCALE = 'en' 
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

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 »

_InternalFieldAccess

Proxy for field access with ViewHelper

« 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 »

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

ViewHelper

interface of all ViewHelpers.

« More »

BaseViewHelper

Parent class for *ViewHelper

« More »

FormHelper

HTML Form tag generation

« More »

ViewControl

Choose how to display the current page

« More »