PHP Class Pheasant

Afficher le fichier Open project: lox/pheasant Class Usage Examples

Méthodes publiques

Méthode Description
__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

Method Details

__construct() public méthode

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

connection() public méthode

Returns a connection by name
public connection ( $name = 'default' ) : object
Résultat object

connections() public méthode

Returns a the connection manager
public connections ( ) : object
Résultat object

events() public méthode

Gets the system-wide events registry
public events ( ) : Events
Résultat Events

finderFor() public méthode

Looks up a finder for either an object or a classname
public finderFor ( $subject ) : Finder
Résultat Finder

initialize() public méthode

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
Résultat string the classname of the object

instance() public static méthode

Returns the static Pheasant instance
public static instance ( ) : Pheasant
Résultat Pheasant

mapperFor() public méthode

Looks up a mapper for either an object or a classname
public mapperFor ( $subject ) : Mapper
Résultat Mapper

register() public méthode

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

registerFinder() public méthode

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

registerMapper() public méthode

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

reset() public static méthode

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

schema() public méthode

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

setup() public static méthode

Shortcut for initializing the static pheasant instance
public static setup ( $dsn = null ) : Pheasant
Résultat Pheasant

transaction() public static méthode

Creates a transaction, optionally executes
public static transaction ( $closure, $execute = true ) : Transaction
Résultat Transaction