PHP Класс Pheasant

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( $dsn = null ) Constructor
connection ( $name = 'default' ) : object Returns a connection by name
connections ( ) : object Returns a the connection manager
events ( ) : Events Gets the system-wide events registry
finderFor ( $subject ) : Finder Looks up a finder for either an object or a classname
initialize ( $subject, $callback = null ) : string Initializes a domain objects schema if it has not yet been initialized
instance ( ) : Pheasant Returns the static Pheasant instance
mapperFor ( $subject ) : Mapper Looks up a mapper for either an object or a classname
register ( $class, $mapper ) Register a mapper for a class, also registers the mapper as a finder
registerFinder ( $class, $mapper ) Registers the finder for a class
registerMapper ( $class, $mapper ) Registers the mapper for a class
reset ( $instance ) Resets the default static Pheasant instance
schema ( $subject ) Gets the schema for an object, initializing it if needed.
setup ( $dsn = null ) : Pheasant Shortcut for initializing the static pheasant instance
transaction ( $closure, $execute = true ) : Transaction Creates a transaction, optionally executes

Описание методов

__construct() публичный Метод

Constructor
public __construct ( $dsn = null )
$dsn string a database dsn

connection() публичный Метод

Returns a connection by name
public connection ( $name = 'default' ) : object
Результат object

connections() публичный Метод

Returns a the connection manager
public connections ( ) : object
Результат object

events() публичный Метод

Gets the system-wide events registry
public events ( ) : Events
Результат Events

finderFor() публичный Метод

Looks up a finder for either an object or a classname
public finderFor ( $subject ) : Finder
Результат Finder

initialize() публичный Метод

Initializes a domain objects schema if it has not yet been initialized
public initialize ( $subject, $callback = null ) : string
$subject either an object or classname to initialize
$callback a callback to call instead of the initialize method
Результат string the classname of the object

instance() публичный статический Метод

Returns the static Pheasant instance
public static instance ( ) : Pheasant
Результат Pheasant

mapperFor() публичный Метод

Looks up a mapper for either an object or a classname
public mapperFor ( $subject ) : Mapper
Результат Mapper

register() публичный Метод

Register a mapper for a class, also registers the mapper as a finder
public register ( $class, $mapper )

registerFinder() публичный Метод

Registers the finder for a class
public registerFinder ( $class, $mapper )

registerMapper() публичный Метод

Registers the mapper for a class
public registerMapper ( $class, $mapper )

reset() публичный статический Метод

Resets the default static Pheasant instance
public static reset ( $instance )

schema() публичный Метод

Gets the schema for an object, initializing it if needed.
public schema ( $subject )
$subject mixed either object or classname

setup() публичный статический Метод

Shortcut for initializing the static pheasant instance
public static setup ( $dsn = null ) : Pheasant
Результат Pheasant

transaction() публичный статический Метод

Creates a transaction, optionally executes
public static transaction ( $closure, $execute = true ) : Transaction
Результат Transaction