class StorageLocationFactory (View source)

Class StorageLocationFactory Get ahold of existing storage locations and create new ones

Properties

protected EntityManagerInterface $entityManager

Methods

__construct(DatabaseManagerORM $manager)

No description

create(ConfigurationInterface $configuration, $name)

Create a new StorageLocation, pass this to StorageLocationFactory->persist() to store this location

persist(StorageLocation $storageLocation)

Store a created storage location to the database

fetchByID(int $id)

Fetch a storage location by its ID

fetchByName(string $name)

Fetch a storage location by its name

fetchList()

Fetch a list of storage locations

fetchDefault()

Fetch the default storage location

Details

__construct(DatabaseManagerORM $manager)

No description

Parameters

DatabaseManagerORM $manager

StorageLocation create(ConfigurationInterface $configuration, $name)

Create a new StorageLocation, pass this to StorageLocationFactory->persist() to store this location

Parameters

ConfigurationInterface $configuration
$name

Return Value

StorageLocation

StorageLocation persist(StorageLocation $storageLocation)

Store a created storage location to the database

Parameters

StorageLocation $storageLocation

Return Value

StorageLocation

The persisted location, may not be the same as the passed in object

null|StorageLocation fetchByID(int $id)

Fetch a storage location by its ID

Parameters

int $id

Return Value

null|StorageLocation

Exceptions

ORMException
OptimisticLockException
TransactionRequiredException

null|StorageLocation fetchByName(string $name)

Fetch a storage location by its name

Parameters

string $name

Return Value

null|StorageLocation

Exceptions

ORMException
OptimisticLockException
TransactionRequiredException

StorageLocation[] fetchList()

Fetch a list of storage locations

Return Value

StorageLocation[]

StorageLocation fetchDefault()

Fetch the default storage location

Return Value

StorageLocation