PHP Class Bolt\Storage\EntityManager

Legacy methods:
Inheritance: implements Bolt\Storage\EntityManagerInterface
Afficher le fichier Open project: bolt/bolt Class Usage Examples

Protected Properties

Свойство Type Description
$aliases array
$builder Bolt\Storage\Entity\Builder
$collectionManager Bolt\Storage\Collection\CollectionManager
$conn Doctrine\DBAL\Connection
$defaultRepositoryFactory Callable
$eventManager Symfony\Component\EventDispatcher\EventDispatcherInterface
$fieldManager FieldManager
$legacyService Bolt\Storage\ContentLegacyService
$legacyStorage Bolt\Legacy\Storage
$logger Psr\Log\LoggerInterface
$mapping Bolt\Storage\Mapping\MetadataDriver
$repositories array

Méthodes publiques

Méthode Description
__call ( string $method, string $args ) : mixed Magic call method acts as a catchall proxy to the legacy repository
__construct ( Doctrine\DBAL\Connection $conn, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventManager, MetadataDriver $mapping, Psr\Log\LoggerInterface $logger = null ) Creates a new EntityManager that operates on the given database connection and uses the given EventManager.
addEntityAlias ( string $alias, string $namespace ) Registers shorter alias access for Entities.
create ( string $className, array $data, Doctrine\Common\Persistence\Mapping\ClassMetadata $metadata = null ) : Bolt\Storage\Entity\Entity Creates an entity of the given class, with the data supplied.
createCollection ( $className ) : mixed Shorthand access method to create collection. Consults aliases to allow short names.
createExpressionBuilder ( ) : Doctrine\DBAL\Query\Expression\ExpressionBuilder
createQueryBuilder ( ) : Doctrine\DBAL\Query\QueryBuilder
delete ( object $object ) : boolean Removes an object instance.
find ( string $className, mixed $id ) : object Finds an object by its identifier.
getCollectionManager ( ) : Bolt\Storage\Collection\CollectionManager
getConnection ( ) : Doctrine\DBAL\Connection Gets the DBAL Driver Connection.
getContent ( string $textquery, array $parameters = [], array &$pager = [], array $whereparameters = [] ) : Content | Content[] Note that this method is explicitly defined here because the magic method above cannot pass dynamic variables by reference
getDefaultRepositoryFactory ( Doctrine\Common\Persistence\Mapping\ClassMetadata $classMetadata ) : callable Returns the default repository factory set on this object
getEntityBuilder ( string $className = null, Bolt\Storage\Mapping\ClassMetadata $classMetadata = null ) : Builder Get an entity builder instance for a given class.
getEventManager ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface Gets the Event Manager.
getFieldManager ( ) : FieldManager
getLogger ( ) : Psr\Log\LoggerInterface Getter for logger object
getMapper ( ) : MetadataDriver Gets the Class Metadata Driver.
getRepository ( $className )
legacy ( ) : Storage Returns a proxy to the legacy storage service
save ( object $object ) : boolean The object will be entered into the database as a result of this operation.
setCollectionManager ( Bolt\Storage\Collection\CollectionManager $collectionManager )
setDefaultRepositoryFactory ( callable $factory ) Sets a default repository factory that can handle metadata that is not mapped to a specific entity.
setEntityBuilder ( Builder $builder ) : Builder Set an entity builder instance.
setFieldManager ( FieldManager $fieldManager )
setLegacyService ( Bolt\Storage\ContentLegacyService $service ) Sets the LegacyRepository
setLegacyStorage ( Storage $storage ) Sets the LegacyRepository
setRepository ( string $entityName, string $repositoryClass ) Sets a custom repository class for an entity.

Method Details

__call() public méthode

Magic call method acts as a catchall proxy to the legacy repository
public __call ( string $method, string $args ) : mixed
$method string
$args string
Résultat mixed

__construct() public méthode

Creates a new EntityManager that operates on the given database connection and uses the given EventManager.
public __construct ( Doctrine\DBAL\Connection $conn, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventManager, MetadataDriver $mapping, Psr\Log\LoggerInterface $logger = null )
$conn Doctrine\DBAL\Connection
$eventManager Symfony\Component\EventDispatcher\EventDispatcherInterface
$mapping Bolt\Storage\Mapping\MetadataDriver
$logger Psr\Log\LoggerInterface

addEntityAlias() public méthode

For example ->addEntityAlias('user', 'Project\Bundle\Module\Entity\User') would allow ->getRepository('user')
public addEntityAlias ( string $alias, string $namespace )
$alias string
$namespace string

create() public méthode

Creates an entity of the given class, with the data supplied.
public create ( string $className, array $data, Doctrine\Common\Persistence\Mapping\ClassMetadata $metadata = null ) : Bolt\Storage\Entity\Entity
$className string The type of entity to create
$data array The data to use to hydrate the new entity
$metadata Doctrine\Common\Persistence\Mapping\ClassMetadata
Résultat Bolt\Storage\Entity\Entity

createCollection() public méthode

Shorthand access method to create collection. Consults aliases to allow short names.
public createCollection ( $className ) : mixed
$className
Résultat mixed

createExpressionBuilder() public méthode

public createExpressionBuilder ( ) : Doctrine\DBAL\Query\Expression\ExpressionBuilder
Résultat Doctrine\DBAL\Query\Expression\ExpressionBuilder

createQueryBuilder() public méthode

public createQueryBuilder ( ) : Doctrine\DBAL\Query\QueryBuilder
Résultat Doctrine\DBAL\Query\QueryBuilder

delete() public méthode

Passed in object will be removed from the database as a result of this operation.
public delete ( object $object ) : boolean
$object object The object instance to remove.
Résultat boolean

find() public méthode

This is just a convenient shortcut for getRepository($className)->find($id).
public find ( string $className, mixed $id ) : object
$className string The class name of the object to find.
$id mixed The identity of the object to find.
Résultat object The found object.

getCollectionManager() public méthode

public getCollectionManager ( ) : Bolt\Storage\Collection\CollectionManager
Résultat Bolt\Storage\Collection\CollectionManager

getConnection() public méthode

Gets the DBAL Driver Connection.
public getConnection ( ) : Doctrine\DBAL\Connection
Résultat Doctrine\DBAL\Connection

getContent() public méthode

Note that this method is explicitly defined here because the magic method above cannot pass dynamic variables by reference
public getContent ( string $textquery, array $parameters = [], array &$pager = [], array $whereparameters = [] ) : Content | Content[]
$textquery string
$parameters array
$pager array
$whereparameters array
Résultat Bolt\Legacy\Content | Bolt\Legacy\Content[]

getDefaultRepositoryFactory() public méthode

Returns the default repository factory set on this object
public getDefaultRepositoryFactory ( Doctrine\Common\Persistence\Mapping\ClassMetadata $classMetadata ) : callable
$classMetadata Doctrine\Common\Persistence\Mapping\ClassMetadata
Résultat callable $factory

getEntityBuilder() public méthode

Get an entity builder instance for a given class.
public getEntityBuilder ( string $className = null, Bolt\Storage\Mapping\ClassMetadata $classMetadata = null ) : Builder
$className string
$classMetadata Bolt\Storage\Mapping\ClassMetadata
Résultat Bolt\Storage\Entity\Builder

getEventManager() public méthode

Gets the Event Manager.
public getEventManager ( ) : Symfony\Component\EventDispatcher\EventDispatcherInterface
Résultat Symfony\Component\EventDispatcher\EventDispatcherInterface

getFieldManager() public méthode

public getFieldManager ( ) : FieldManager
Résultat FieldManager

getLogger() public méthode

Getter for logger object
public getLogger ( ) : Psr\Log\LoggerInterface
Résultat Psr\Log\LoggerInterface

getMapper() public méthode

Gets the Class Metadata Driver.
public getMapper ( ) : MetadataDriver
Résultat Bolt\Storage\Mapping\MetadataDriver

getRepository() public méthode

public getRepository ( $className )

legacy() public méthode

Returns a proxy to the legacy storage service
public legacy ( ) : Storage
Résultat Bolt\Legacy\Storage

save() public méthode

The object will be entered into the database as a result of this operation.
public save ( object $object ) : boolean
$object object The instance to persist to storage.
Résultat boolean

setCollectionManager() public méthode

public setCollectionManager ( Bolt\Storage\Collection\CollectionManager $collectionManager )
$collectionManager Bolt\Storage\Collection\CollectionManager

setDefaultRepositoryFactory() public méthode

Sets a default repository factory that can handle metadata that is not mapped to a specific entity.
public setDefaultRepositoryFactory ( callable $factory )
$factory callable

setEntityBuilder() public méthode

Set an entity builder instance.
public setEntityBuilder ( Builder $builder ) : Builder
$builder Bolt\Storage\Entity\Builder
Résultat Bolt\Storage\Entity\Builder

setFieldManager() public méthode

public setFieldManager ( FieldManager $fieldManager )
$fieldManager FieldManager

setLegacyService() public méthode

Sets the LegacyRepository
public setLegacyService ( Bolt\Storage\ContentLegacyService $service )
$service Bolt\Storage\ContentLegacyService

setLegacyStorage() public méthode

Sets the LegacyRepository
public setLegacyStorage ( Storage $storage )
$storage Bolt\Legacy\Storage

setRepository() public méthode

Sets a custom repository class for an entity.
public setRepository ( string $entityName, string $repositoryClass )
$entityName string
$repositoryClass string

Property Details

$aliases protected_oe property

protected array $aliases
Résultat array

$builder protected_oe property

protected Builder,Bolt\Storage\Entity $builder
Résultat Bolt\Storage\Entity\Builder

$collectionManager protected_oe property

protected CollectionManager,Bolt\Storage\Collection $collectionManager
Résultat Bolt\Storage\Collection\CollectionManager

$conn protected_oe property

protected Connection,Doctrine\DBAL $conn
Résultat Doctrine\DBAL\Connection

$defaultRepositoryFactory protected_oe property

protected Callable $defaultRepositoryFactory
Résultat Callable

$eventManager protected_oe property

protected EventDispatcherInterface,Symfony\Component\EventDispatcher $eventManager
Résultat Symfony\Component\EventDispatcher\EventDispatcherInterface

$fieldManager protected_oe property

protected FieldManager,Bolt\Storage $fieldManager
Résultat FieldManager

$legacyService protected_oe property

protected ContentLegacyService,Bolt\Storage $legacyService
Résultat Bolt\Storage\ContentLegacyService

$legacyStorage protected_oe property

protected Storage,Bolt\Legacy $legacyStorage
Résultat Bolt\Legacy\Storage

$logger protected_oe property

protected LoggerInterface,Psr\Log $logger
Résultat Psr\Log\LoggerInterface

$mapping protected_oe property

protected MetadataDriver,Bolt\Storage\Mapping $mapping
Résultat Bolt\Storage\Mapping\MetadataDriver

$repositories protected_oe property

protected array $repositories
Résultat array