PHP 클래스 Mongolid\Manager

With the Mongolid\Manager, you can start using Mongolid with pure PHP by simply calling the addConnection method.
파일 보기 프로젝트 열기: leroy-merlin-br/mongolid 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$cacheComponent Mongolid\Util\CacheComponent Mongolid cache component object.
$connectionPool Mongolid\Connection\Pool Mongolid connection pool being object.
$container Illuminate\Contracts\Container Container being used by Mongolid.

보호된 프로퍼티들

프로퍼티 타입 설명
$schemas array Stores the schemas that have been registered for later use. This may be useful when using Mongolid DataMapper pattern.
$singleton Manager Singleton instance of the manager.

공개 메소드들

메소드 설명
addConnection ( Connection $connection ) : boolean Main entry point to openning a connection and start using Mongolid in pure PHP. After adding a connection into the Manager you are ready to persist and query your models.
getConnection ( ) : MongoDB\Client Get the raw MongoDB connection.
getMapper ( string $entityClass ) : DataMapper | null Retrieves a DataMapper for the given $entityClass. This can only be done if the Schema for that entity has been previously registered with registerSchema() method.
registerSchema ( Schema $schema ) : void Allow document Schemas to be registered for later use.
setEventTrigger ( Mongolid\Event\EventTriggerInterface $eventTrigger ) : void Sets the event trigger for Mongolid events.

보호된 메소드들

메소드 설명
init ( ) : void Initializes the Mongolid manager.

메소드 상세

addConnection() 공개 메소드

Main entry point to openning a connection and start using Mongolid in pure PHP. After adding a connection into the Manager you are ready to persist and query your models.
public addConnection ( Connection $connection ) : boolean
$connection Mongolid\Connection\Connection Connection instance to be used in database interactions.
리턴 boolean Success

getConnection() 공개 메소드

Get the raw MongoDB connection.
public getConnection ( ) : MongoDB\Client
리턴 MongoDB\Client

getMapper() 공개 메소드

Retrieves a DataMapper for the given $entityClass. This can only be done if the Schema for that entity has been previously registered with registerSchema() method.
public getMapper ( string $entityClass ) : DataMapper | null
$entityClass string Class of the entity that needs to be mapped.
리턴 Mongolid\DataMapper\DataMapper | null DataMapper configured for the $entityClass.

init() 보호된 메소드

Initializes the Mongolid manager.
protected init ( ) : void
리턴 void

registerSchema() 공개 메소드

Allow document Schemas to be registered for later use.
public registerSchema ( Schema $schema ) : void
$schema Mongolid\Schema\Schema Schema being registered.
리턴 void

setEventTrigger() 공개 메소드

Sets the event trigger for Mongolid events.
public setEventTrigger ( Mongolid\Event\EventTriggerInterface $eventTrigger ) : void
$eventTrigger Mongolid\Event\EventTriggerInterface External event trigger.
리턴 void

프로퍼티 상세

$cacheComponent 공개적으로 프로퍼티

Mongolid cache component object.
public CacheComponent,Mongolid\Util $cacheComponent
리턴 Mongolid\Util\CacheComponent

$connectionPool 공개적으로 프로퍼티

Mongolid connection pool being object.
public Pool,Mongolid\Connection $connectionPool
리턴 Mongolid\Connection\Pool

$container 공개적으로 프로퍼티

Container being used by Mongolid.
public Container,Illuminate\Contracts $container
리턴 Illuminate\Contracts\Container

$schemas 보호되어 있는 프로퍼티

Stores the schemas that have been registered for later use. This may be useful when using Mongolid DataMapper pattern.
protected array $schemas
리턴 array

$singleton 보호되어 있는 정적으로 프로퍼티

Singleton instance of the manager.
protected static Manager,mongolid $singleton
리턴 Manager