PHP 클래스 Pheasant

파일 보기 프로젝트 열기: lox/pheasant 1 사용 예제들

공개 메소드들

메소드 설명
__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