PlanetLib
extends Model
in package
PlanetLib Class
Table of Contents
- $db : Database
- Contains the Database instance
- __construct() : mixed
- Constructor
- __destruct() : mixed
- Destructor
- checkMoonExists() : array<string|int, mixed>|null
- Check if a moon exists
- checkPlanetExists() : array<string|int, mixed>|null
- Check if a planet exists
- createNewPlanet() : void
- Create a new planet
- insertPlanetBuildings() : void
- Insert a new record into buildings table
- insertPlanetDefenses() : void
- Insert a new record into defenses table
- insertPlanetShips() : void
- Insert a new record into ships table
- setNewDb() : void
- Creates a new Database object
Properties
$db
Contains the Database instance
protected
Database
$db
Methods
__construct()
Constructor
public
__construct() : mixed
Return values
mixed —__destruct()
Destructor
public
__destruct() : mixed
Return values
mixed —checkMoonExists()
Check if a moon exists
public
checkMoonExists(int $galaxy, int $system, int $position) : array<string|int, mixed>|null
Parameters
- $galaxy : int
- $system : int
- $position : int
Return values
array<string|int, mixed>|null —checkPlanetExists()
Check if a planet exists
public
checkPlanetExists(int $galaxy, int $system, int $position) : array<string|int, mixed>|null
Parameters
- $galaxy : int
- $system : int
- $position : int
Return values
array<string|int, mixed>|null —createNewPlanet()
Create a new planet
public
createNewPlanet(array<string|int, mixed> $data[, bool $full_insert = true ]) : void
Parameters
- $data : array<string|int, mixed>
- $full_insert : bool = true
Return values
void —insertPlanetBuildings()
Insert a new record into buildings table
private
insertPlanetBuildings(int $planet_id) : void
Parameters
- $planet_id : int
Return values
void —insertPlanetDefenses()
Insert a new record into defenses table
private
insertPlanetDefenses(int $planet_id) : void
Parameters
- $planet_id : int
Return values
void —insertPlanetShips()
Insert a new record into ships table
private
insertPlanetShips(int $planet_id) : void
Parameters
- $planet_id : int
Return values
void —setNewDb()
Creates a new Database object
private
setNewDb() : void