PHP Class Bravo3\Orm\Services\Maintenance

Show file Open project: bravo3/orm Class Usage Examples

Protected Properties

Property Type Description
$entity_manager EntityManager
$logger Psr\Log\LoggerInterface

Public Methods

Method Description
__construct ( EntityManager $entity_manager, Psr\Log\LoggerInterface $logger = null )
rebuild ( string $class_name, integer $batch_size = 100 ) Will rebuild a table, repairing indices and re-serialising content

Protected Methods

Method Description
maintenanceOperation ( callable $closure ) Execute a function in maintenance mode

Private Methods

Method Description
rebuildRecords ( Traversable $records, integer $batch_size ) Re-persist an array of records

Method Details

__construct() public method

public __construct ( EntityManager $entity_manager, Psr\Log\LoggerInterface $logger = null )
$entity_manager EntityManager
$logger Psr\Log\LoggerInterface

maintenanceOperation() protected method

Execute a function in maintenance mode
protected maintenanceOperation ( callable $closure )
$closure callable

rebuild() public method

The end result will be: - new inverse indices will be created - changes to serialisation will be updated on all entities - added/removed fields will be updated on all entities
public rebuild ( string $class_name, integer $batch_size = 100 )
$class_name string
$batch_size integer

Property Details

$entity_manager protected property

protected EntityManager,Bravo3\Orm\Services $entity_manager
return EntityManager

$logger protected property

protected LoggerInterface,Psr\Log $logger
return Psr\Log\LoggerInterface