Baleen\Migrations\VersionRepository\RepositoryStack¶
-
class
RepositoryStack
¶ A generic repository that can aggregate one or more other repositories
-
__construct
()¶ RepositoryStack constructor.
-
addRepository
(MigrationRepositoryInterface $repo)¶ Adds a single repository to the stack
Parameters: - $repo (MigrationRepositoryInterface) –
-
addRepositories
($repositories)¶ Adds a set of repositories to the stack
Parameters: - $repositories –
-
getRepositories
()¶ Returns the stack
Returns: SplStack|MigrationRepositoryInterface[]
-
setRepositories
($repositories)¶ Resets the stack to the specified repositories
Parameters: - $repositories (array|Traversable) –
-
fetchAll
()¶ Fetches all versions available to all repositories in the stack and returns them as a Linked collection.
The returned collection contains versions groups sequentially into groups that correspond to each sub-repository. Each of those groups is sorted with the repository’s own comparator. Therefore, its strongly recommended not to sort or modify the resulting collection.
Returns: Linked
-
setMigrationFactory
(FactoryInterface $factory)¶ Sets the migration factory for ALL repositories in the stack.
Parameters: - $factory (FactoryInterface) –
-