Documentation

Database extends AbstractModel
in package

Database model class

Tags
category

Pop\Kettle

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
1.6.2

Table of Contents

$data  : array<string|int, mixed>
Array data
__construct()  : mixed
Constructor
__get()  : mixed
Get a value
__isset()  : bool
Is value set
__serialize()  : string
Serialize megic method
__set()  : ArrayObject
Set a value
__unserialize()  : ArrayObject
Unserialize magic method
__unset()  : void
Unset a value
clear()  : Database
Clear database
configure()  : Database
Configure database
count()  : int
Method to get the count of the array object
createAdapter()  : AbstractAdapter
Create database adapter
createFromJson()  : ArrayObject
Create array object from JSON string
createFromSerialized()  : ArrayObject
Create array object from serialized string
getIterator()  : ArrayIterator
Method to iterate over the array object
install()  : Database
Install SQL
jsonSerialize()  : string
JSON serialize the array object
jsonUnserialize()  : ArrayObject
Unserialize a JSON string
offsetExists()  : bool
ArrayAccess offsetExists
offsetGet()  : mixed
ArrayAccess offsetGet
offsetSet()  : void
ArrayAccess offsetSet
offsetUnset()  : void
ArrayAccess offsetUnset
reset()  : Database
Reset database
seed()  : Database
Seed database
serialize()  : string
Serialize the array object
test()  : string|bool
Test database connection
toArray()  : array<string|int, mixed>
Get the values as an array
unserialize()  : ArrayObject
Unserialize a string

Properties

$data

Array data

protected array<string|int, mixed> $data = []

Methods

__construct()

Constructor

public __construct([mixed $data = null ]) : mixed

Instantiate the array object

Parameters
$data : mixed = null
Tags
throws
Exception
Return values
mixed

__get()

Get a value

public __get(string $name) : mixed
Parameters
$name : string
Return values
mixed

__isset()

Is value set

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__serialize()

Serialize megic method

public __serialize() : string
Return values
string

__unserialize()

Unserialize magic method

public __unserialize(array<string|int, mixed> $data) : ArrayObject
Parameters
$data : array<string|int, mixed>
Return values
ArrayObject

__unset()

Unset a value

public __unset(string $name) : void
Parameters
$name : string
Return values
void

clear()

Clear database

public clear(Console $console, string $location[, string $database = 'default' ]) : Database
Parameters
$console : Console
$location : string
$database : string = 'default'
Return values
Database

configure()

Configure database

public configure(Console $console, string $location[, string $database = 'default' ]) : Database
Parameters
$console : Console
$location : string
$database : string = 'default'
Return values
Database

count()

Method to get the count of the array object

public count() : int
Return values
int

createAdapter()

Create database adapter

public createAdapter(array<string|int, mixed> $database) : AbstractAdapter
Parameters
$database : array<string|int, mixed>
Return values
AbstractAdapter

createFromJson()

Create array object from JSON string

public static createFromJson(string $jsonString[, int $depth = 512 ], int $options) : ArrayObject
Parameters
$jsonString : string
$depth : int = 512
$options : int
Return values
ArrayObject

createFromSerialized()

Create array object from serialized string

public static createFromSerialized(string $string) : ArrayObject
Parameters
$string : string
Return values
ArrayObject

getIterator()

Method to iterate over the array object

public getIterator() : ArrayIterator
Return values
ArrayIterator

install()

Install SQL

public install(array<string|int, mixed> $database, string $sqlFile) : Database
Parameters
$database : array<string|int, mixed>
$sqlFile : string
Return values
Database

jsonSerialize()

JSON serialize the array object

public jsonSerialize(int $options[, int $depth = 512 ]) : string
Parameters
$options : int
$depth : int = 512
Return values
string

jsonUnserialize()

Unserialize a JSON string

public jsonUnserialize(string $jsonString[, int $depth = 512 ], int $options) : ArrayObject
Parameters
$jsonString : string
$depth : int = 512
$options : int
Return values
ArrayObject

offsetExists()

ArrayAccess offsetExists

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

ArrayAccess offsetGet

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed
Return values
mixed

offsetSet()

ArrayAccess offsetSet

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
Return values
void

offsetUnset()

ArrayAccess offsetUnset

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed
Return values
void

reset()

Reset database

public reset(Console $console, string $location[, string $database = 'default' ]) : Database
Parameters
$console : Console
$location : string
$database : string = 'default'
Return values
Database

seed()

Seed database

public seed(Console $console, string $location[, string $database = 'default' ]) : Database
Parameters
$console : Console
$location : string
$database : string = 'default'
Return values
Database

serialize()

Serialize the array object

public serialize([bool $self = false ]) : string
Parameters
$self : bool = false
Return values
string

test()

Test database connection

public test(array<string|int, mixed> $database) : string|bool
Parameters
$database : array<string|int, mixed>
Return values
string|bool

toArray()

Get the values as an array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

Search results