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

Exceptions

Exception

StorageLocation|null fetchByID(int $id)

Fetch a storage location by its ID.

Parameters

int $id

Return Value

StorageLocation|null

Exceptions

ORMException
OptimisticLockException
TransactionRequiredException

StorageLocation|null fetchByName(string $name)

Fetch a storage location by its name.

Parameters

string $name

Return Value

StorageLocation|null

StorageLocation[] fetchList()

Fetch a list of storage locations.

Return Value

StorageLocation[]

StorageLocation fetchDefault()

Fetch the default storage location.

Return Value

StorageLocation