Documentation

Beatnik_Driver_sql extends Beatnik_Driver
in package

Copyright 2006-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

Tags
author

Duck duck@obala.net

Table of Contents

$_connected  : bool
Boolean indicating whether or not we're connected to the SQL server.
$_db  : DB
Handle for the current database connection.
$_params  : array<string|int, mixed>
Hash containing connection parameters.
$_write_db  : DB
Handle for the current database connection, used for writing. Defaults to the same handle as $_db if a separate write database is not required.
_connect()  : bool
Attempts to open a persistent connection to the SQL server.
_deleteRecord()  : bool
Delete record from backend
_getDomains()  : array<string|int, mixed>
Gets all zones
_saveRecord()  : bool
Saves a new or edited record to the DNS backend
Beatnik_Driver()  : mixed
Beatnik_Driver_sql()  : mixed
Constructs a new Beatnik DB driver object.
deleteRecord()  : bool
Delete record from backend
factory()  : mixed
Attempts to return a concrete Beatnik_Driver instance based on $driver.
getDomain()  : array<string|int, mixed>
Return SOA for a single domain
getDomains()  : array<string|int, mixed>
Gets domains from driver for which the user has the specified permission.
getRecDriverFields()  : array<string|int, mixed>
Get any fields available specifically in this driver by record type.
getRecDriverTypes()  : array<string|int, mixed>
Get any record types available specifically in this driver.
getRecord()  : array<string|int, mixed>
Gets a specific record from the backend. This method may be overridden in specific backend drivers if there is a performance or other benefit for doing so.
getRecords()  : array<string|int, mixed>
Gets all records associated with the given zone
recordExists()  : bool
Try to determinate if the autogenerated record already exits. This method may be overridden in the backend driver for performance or other reasons.
saveRecord()  : mixed
Saves a record fo the configured driver and checks/sets needCommit() Also first checks to ensure permission to save record is available.

Properties

$_connected

Boolean indicating whether or not we're connected to the SQL server.

public bool $_connected = alse

$_db

Handle for the current database connection.

public DB $_db

$_params

Hash containing connection parameters.

public array<string|int, mixed> $_params = array()

$_write_db

Handle for the current database connection, used for writing. Defaults to the same handle as $_db if a separate write database is not required.

public DB $_write_db

Methods

_connect()

Attempts to open a persistent connection to the SQL server.

public _connect() : bool
Tags
access

private

Return values
bool

True on success.

_deleteRecord()

Delete record from backend

public _deleteRecord(array<string|int, mixed> $data) : bool
Parameters
$data : array<string|int, mixed>

Reference to array of record data to be deleted

Tags
access

private

Return values
bool

true on success, PEAR::Error on error

_getDomains()

Gets all zones

public _getDomains() : array<string|int, mixed>
Tags
access

private

Return values
array<string|int, mixed>

Array with zone records numerically indexed

_saveRecord()

Saves a new or edited record to the DNS backend

public _saveRecord(array<string|int, mixed> $info) : bool
Parameters
$info : array<string|int, mixed>

Array of record data

Tags
access

private

Return values
bool

true on success

Beatnik_Driver()

public Beatnik_Driver([mixed $params = array() ]) : mixed
Parameters
$params : mixed = array()
Return values
mixed

Beatnik_Driver_sql()

Constructs a new Beatnik DB driver object.

public Beatnik_Driver_sql([array<string|int, mixed> $params = array() ]) : mixed
Parameters
$params : array<string|int, mixed> = array()

A hash containing connection parameters.

Return values
mixed

deleteRecord()

Delete record from backend

public deleteRecord(array<string|int, mixed> &$info) : bool
Parameters
$info : array<string|int, mixed>

Reference to array of record information for deletion

Tags
access

private

Return values
bool

true on success

factory()

Attempts to return a concrete Beatnik_Driver instance based on $driver.

public factory([string $driver = null ][, array<string|int, mixed> $params = null ]) : mixed
Parameters
$driver : string = null

The type of the concrete Beatnik_Driver subclass to return. The class name is based on the storage driver ($driver). The code is dynamically included.

$params : array<string|int, mixed> = null

(optional) A hash containing any additional configuration or connection parameters a subclass might need.

Return values
mixed

The newly created concrete Beatnik_Driver instance, or false on an error.

getDomain()

Return SOA for a single domain

public getDomain(mixed $domainname) : array<string|int, mixed>
Parameters
$domainname : mixed
Return values
array<string|int, mixed>

Domain SOA

getDomains()

Gets domains from driver for which the user has the specified permission.

public getDomains([int $perms = Horde_Perms::SHOW ]) : array<string|int, mixed>
Parameters
$perms : int = Horde_Perms::SHOW

Permissions filter for domain result set

Return values
array<string|int, mixed>

Possibly empty array of domain information

getRecDriverFields()

Get any fields available specifically in this driver by record type.

public getRecDriverFields(string $type) : array<string|int, mixed>
Parameters
$type : string

Record type for which fields should be returned

Return values
array<string|int, mixed>

Fields specific to this driver

getRecDriverTypes()

Get any record types available specifically in this driver.

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

Records available only to this driver

getRecord()

Gets a specific record from the backend. This method may be overridden in specific backend drivers if there is a performance or other benefit for doing so.

public getRecord(mixed $id) : array<string|int, mixed>
Parameters
$id : mixed
Return values
array<string|int, mixed>

Array of type and record information

getRecords()

Gets all records associated with the given zone

public getRecords(string $domain) : array<string|int, mixed>
Parameters
$domain : string

Retrieve records for this domain

Return values
array<string|int, mixed>

Array with zone records

recordExists()

Try to determinate if the autogenerated record already exits. This method may be overridden in the backend driver for performance or other reasons.

public recordExists(array<string|int, mixed> $record, mixed $rectype) : bool
Parameters
$record : array<string|int, mixed>

record to check

$rectype : mixed
Return values
bool

if records exits or or not

saveRecord()

Saves a record fo the configured driver and checks/sets needCommit() Also first checks to ensure permission to save record is available.

public saveRecord(array<string|int, mixed> &$info) : mixed
Parameters
$info : array<string|int, mixed>

Data to be passed to backend driver for storage

Return values
mixed

True on success, PEAR::Error on error

Search results