PHP Class Backend\Modules\Location\Engine\Model

Show file Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
delete ( integer $id ) Delete an item
exists ( integer $id ) : boolean Check if an item exists
get ( integer $id ) : array Fetch a record from the database
getAll ( ) : array Fetch a record from the database
getCoordinates ( string $street = null, string $streetNumber = null, string $city = null, string $zip = null, string $country = null ) : array Get coordinates latitude/longitude
getMapSetting ( integer $mapId, string $name ) : mixed Retrieve a map setting
getMapSettings ( integer $mapId ) : array Fetch all the settings for a specific map
insert ( array $item ) : integer Insert an item
setMapSetting ( integer $mapId, string $key, mixed $value ) Save the map settings
update ( array $item ) : integer Update an item

Method Details

delete() public static method

Delete an item
public static delete ( integer $id )
$id integer The id of the record to delete.

exists() public static method

Check if an item exists
public static exists ( integer $id ) : boolean
$id integer The id of the record to look for.
return boolean

get() public static method

Fetch a record from the database
public static get ( integer $id ) : array
$id integer The id of the record to fetch.
return array

getAll() public static method

Fetch a record from the database
public static getAll ( ) : array
return array

getCoordinates() public static method

Get coordinates latitude/longitude
public static getCoordinates ( string $street = null, string $streetNumber = null, string $city = null, string $zip = null, string $country = null ) : array
$street string
$streetNumber string
$city string
$zip string
$country string
return array Contains 'latitude' and 'longitude' as variables

getMapSetting() public static method

Retrieve a map setting
public static getMapSetting ( integer $mapId, string $name ) : mixed
$mapId integer
$name string
return mixed

getMapSettings() public static method

Fetch all the settings for a specific map
public static getMapSettings ( integer $mapId ) : array
$mapId integer
return array

insert() public static method

Insert an item
public static insert ( array $item ) : integer
$item array The data of the record to insert.
return integer

setMapSetting() public static method

Save the map settings
public static setMapSetting ( integer $mapId, string $key, mixed $value )
$mapId integer
$key string
$value mixed

update() public static method

Update an item
public static update ( array $item ) : integer
$item array The data of the record to update.
return integer