Body
extends Entity
in package
Geo body class
Table of Contents
Properties
- $asteroid : bool
- $code : string
- $description : string
- $hidden : bool
- $hypership : bool
- $lastError : string
- $location : mixed
- $moon : bool
- $name : string
- $orbital : bool
- $planet : bool
- $star : bool
- $db : DatabaseEngine
Methods
- __construct() : mixed
- Initializes a new instance
- __toString() : string
- Gets the name of the body, as a string representation of the object
- getDatabase() : DatabaseEngine
- getFullCode() : string
- getStatus() : string
- Gets the status field
- kind() : string
- Gets the kind of place the body is (e.g. asteroid)
- load_from_database() : bool
- Loads the object body (ie fill the properties) from the database
- load_from_form() : mixed
- Loads the object body (ie fill the properties) from the $_POST array
- save_to_database() : void
- Saves to database
- setDatabase() : void
Properties
$asteroid
public
bool
$asteroid
= false
$code
public
string
$code
$description
public
string
$description
$hidden
public
bool
$hidden
= false
$hypership
public
bool
$hypership
= false
$lastError
public
string
$lastError
= ""
$location
public
mixed
$location
$moon
public
bool
$moon
= false
$name
public
string
$name
$orbital
public
bool
$orbital
= false
$planet
public
bool
$planet
= false
$star
public
bool
$star
= false
$db
private
DatabaseEngine
$db
Methods
__construct()
Initializes a new instance
public
__construct(DatabaseEngine $db[, string|int $code = null ]) : mixed
Parameters
- $db : DatabaseEngine
- $code : string|int = null
__toString()
Gets the name of the body, as a string representation of the object
public
__toString() : string
Return values
string —the name of the body
getDatabase()
public
getDatabase() : DatabaseEngine
Return values
DatabaseEnginegetFullCode()
public
getFullCode() : string
Return values
stringgetStatus()
Gets the status field
public
getStatus() : string
Return values
string —the status field value (e.g. "asteroid,hidden")
kind()
Gets the kind of place the body is (e.g. asteroid)
public
kind() : string
Return values
string —the kind of place
load_from_database()
Loads the object body (ie fill the properties) from the database
public
load_from_database() : bool
Return values
boolload_from_form()
Loads the object body (ie fill the properties) from the $_POST array
public
load_from_form([bool $readBoolean = true ]) : mixed
Parameters
- $readBoolean : bool = true
-
if false, don't read any form item matching a boolean field to avoid to set it to false if there are absent from a form.
save_to_database()
Saves to database
public
save_to_database() : void
setDatabase()
public
setDatabase(DatabaseEngine $db) : void
Parameters
- $db : DatabaseEngine