PHP Class Pagekit\Database\ORM\MetadataManager

Mostrar archivo Open project: pagekit/pagekit Class Usage Examples

Protected Properties

Property Type Description
$cache Doctrine\Common\Cache\Cache
$connection Pagekit\Database\Connection
$events Pagekit\Event\EventDispatcherInterface
$loader Pagekit\Database\ORM\Loader\LoaderInterface
$metadata Pagekit\Database\ORM\Metadata[]
$prefix string The cache prefix

Public Methods

Method Description
__construct ( Pagekit\Database\Connection $connection, Pagekit\Event\EventDispatcherInterface $events ) Constructor.
get ( object | string $class ) : Pagekit\Database\ORM\Metadata Gets the metadata for the given class.
getCache ( ) : Doctrine\Common\Cache\Cache Gets the cache used for caching Metadata objects.
getConnection ( ) : Pagekit\Database\Connection Gets the database connection.
has ( string $class ) : boolean Checks if the metadata for a class is already loaded.
setCache ( Doctrine\Common\Cache\Cache $cache ) Sets the cache used for caching Metadata objects.
setLoader ( Pagekit\Database\ORM\Loader\LoaderInterface $loader ) Sets the loader object used by the factory to create Metadata objects.

Protected Methods

Method Description
getParentClasses ( ReflectionClass $class ) : array Get array of parent classes for the given class.
load ( ReflectionClass $class ) : Pagekit\Database\ORM\Metadata Loads the metadata of the given class.
subscribe ( Pagekit\Database\ORM\Metadata $metadata ) Subscribes model lifecycle callbacks.

Method Details

__construct() public method

Constructor.
public __construct ( Pagekit\Database\Connection $connection, Pagekit\Event\EventDispatcherInterface $events )
$connection Pagekit\Database\Connection
$events Pagekit\Event\EventDispatcherInterface

get() public method

Gets the metadata for the given class.
public get ( object | string $class ) : Pagekit\Database\ORM\Metadata
$class object | string
return Pagekit\Database\ORM\Metadata

getCache() public method

Gets the cache used for caching Metadata objects.
public getCache ( ) : Doctrine\Common\Cache\Cache
return Doctrine\Common\Cache\Cache

getConnection() public method

Gets the database connection.
public getConnection ( ) : Pagekit\Database\Connection
return Pagekit\Database\Connection

getParentClasses() protected method

Get array of parent classes for the given class.
protected getParentClasses ( ReflectionClass $class ) : array
$class ReflectionClass
return array

has() public method

Checks if the metadata for a class is already loaded.
public has ( string $class ) : boolean
$class string
return boolean

load() protected method

Loads the metadata of the given class.
protected load ( ReflectionClass $class ) : Pagekit\Database\ORM\Metadata
$class ReflectionClass
return Pagekit\Database\ORM\Metadata

setCache() public method

Sets the cache used for caching Metadata objects.
public setCache ( Doctrine\Common\Cache\Cache $cache )
$cache Doctrine\Common\Cache\Cache

setLoader() public method

Sets the loader object used by the factory to create Metadata objects.
public setLoader ( Pagekit\Database\ORM\Loader\LoaderInterface $loader )
$loader Pagekit\Database\ORM\Loader\LoaderInterface

subscribe() protected method

Subscribes model lifecycle callbacks.
protected subscribe ( Pagekit\Database\ORM\Metadata $metadata )
$metadata Pagekit\Database\ORM\Metadata

Property Details

$cache protected_oe property

protected Cache,Doctrine\Common\Cache $cache
return Doctrine\Common\Cache\Cache

$connection protected_oe property

protected Connection,Pagekit\Database $connection
return Pagekit\Database\Connection

$events protected_oe property

protected EventDispatcherInterface,Pagekit\Event $events
return Pagekit\Event\EventDispatcherInterface

$loader protected_oe property

protected LoaderInterface,Pagekit\Database\ORM\Loader $loader
return Pagekit\Database\ORM\Loader\LoaderInterface

$metadata protected_oe property

protected Metadata[],Pagekit\Database\ORM $metadata
return Pagekit\Database\ORM\Metadata[]

$prefix protected_oe property

The cache prefix
protected string $prefix
return string