PHP Class Spot\Adapter\AdapterAbstract

ファイルを表示 Open project: vlucas/spot Class Usage Examples

Protected Properties

Property Type Description
$_connection Connection details
$_dsn
$_dsnParts
$_format_date Format for date columns, formatted for PHP's date() function
$_format_datetime
$_format_time
$_options

Public Methods

Method Description
__construct ( mixed $dsn, array $options = [] )
date ( $format = null ) : object Get date
dateFormat ( ) : string Get database format
dateTime ( $format = null ) : object Get datetime
dateTimeFormat ( ) : string Get database format
parseDSN ( string $dsn ) : array Taken from PHPUnit 3.4:
time ( $format = null ) : object Get database time format
timeFormat ( ) : string Get database time format

Protected Methods

Method Description
dateTimeObject ( $format ) : DateTime Turn formstted date into timestamp Also handles input timestamps

Method Details

__construct() public method

public __construct ( mixed $dsn, array $options = [] )
$dsn mixed DSN string or pre-existing Mongo object
$options array

date() public method

Get date
public date ( $format = null ) : object
return object DateTime

dateFormat() public method

Get database format
public dateFormat ( ) : string
return string Date format for PHP's date() function

dateTime() public method

Get datetime
public dateTime ( $format = null ) : object
return object DateTIme

dateTimeFormat() public method

Get database format
public dateTimeFormat ( ) : string
return string DateTime format for PHP's date() function

dateTimeObject() protected method

Turn formstted date into timestamp Also handles input timestamps
protected dateTimeObject ( $format ) : DateTime
return DateTime object

parseDSN() public static method

Taken from PHPUnit 3.4:
public static parseDSN ( string $dsn ) : array
$dsn string Data Source Name to be parsed
return array an associative array with the following keys: + adapter: Database backend used in PHP (mysql, odbc etc.) + dbsyntax: Database used with regards to SQL syntax etc. + protocol: Communication protocol to use (tcp, unix etc.) + host: Host specification (hostname[:port]) + database: Database to use on the DBMS server + username: User name for login + password: Password for login

time() public method

Get database time format
public time ( $format = null ) : object
return object DateTime

timeFormat() public method

Get database time format
public timeFormat ( ) : string
return string Time format for PHP's date() function

Property Details

$_connection protected_oe property

Connection details
protected $_connection

$_dsn protected_oe property

protected $_dsn

$_dsnParts protected_oe property

protected $_dsnParts

$_format_date protected_oe property

Format for date columns, formatted for PHP's date() function
protected $_format_date

$_format_datetime protected_oe property

protected $_format_datetime

$_format_time protected_oe property

protected $_format_time

$_options protected_oe property

protected $_options