mediatekformation

ORMPurger
in package
implements PurgerInterface, ORMPurgerInterface

Class responsible for purging databases of data before reloading data fixtures.

Interfaces, Classes, Traits and Enums

PurgerInterface
PurgerInterface
ORMPurgerInterface
ORMPurgerInterface

Table of Contents

PURGE_MODE_DELETE  = 1
PURGE_MODE_TRUNCATE  = 2
$em  : EntityManagerInterface|null
$excluded  : array<string|int, string>
Table/view names to be excluded from purge
$purgeMode  : int
If the purge should be done through DELETE or TRUNCATE statements
__construct()  : mixed
Construct new purger instance.
getObjectManager()  : EntityManagerInterface
Retrieve the EntityManagerInterface instance this purger instance is using.
getPurgeMode()  : int
Get the purge mode
purge()  : void
Purge the data from the database for the given EntityManager.
setEntityManager()  : void
Set the EntityManagerInterface instance this purger instance should use.
setPurgeMode()  : void
Set the purge mode
getAssociationTables()  : array<string|int, mixed>
getCommitOrder()  : array<string|int, ClassMetadata>
getDeleteFromTableSQL()  : string
getJoinTableName()  : string
getTableName()  : string

Constants

PURGE_MODE_DELETE

public mixed PURGE_MODE_DELETE = 1

PURGE_MODE_TRUNCATE

public mixed PURGE_MODE_TRUNCATE = 2

Properties

$excluded

Table/view names to be excluded from purge

private array<string|int, string> $excluded

$purgeMode

If the purge should be done through DELETE or TRUNCATE statements

private int $purgeMode = self::PURGE_MODE_DELETE

Methods

__construct()

Construct new purger instance.

public __construct([EntityManagerInterface $em = null ][, array<string|int, string> $excluded = [] ]) : mixed
Parameters
$em : EntityManagerInterface = null

EntityManagerInterface instance used for persistence.

$excluded : array<string|int, string> = []

array of table/view names to be excluded from purge

Return values
mixed

getPurgeMode()

Get the purge mode

public getPurgeMode() : int
Return values
int

purge()

Purge the data from the database for the given EntityManager.

public purge() : void
Tags
inheritDoc
Return values
void

setPurgeMode()

Set the purge mode

public setPurgeMode(int $mode) : void
Parameters
$mode : int
Return values
void

getAssociationTables()

private getAssociationTables(array<string|int, mixed> $classes, AbstractPlatform $platform) : array<string|int, mixed>
Parameters
$classes : array<string|int, mixed>
$platform : AbstractPlatform
Return values
array<string|int, mixed>

Search results