PHP Class Bravo3\Orm\Services\Porter

Inheritance: implements Psr\Log\LoggerAwareInterface
显示文件 Open project: bravo3/orm Class Usage Examples

Protected Properties

Property Type Description
$logger Psr\Log\LoggerInterface
$managers EntityManager[]

Public Methods

Method Description
__construct ( Psr\Log\LoggerInterface $logger = null )
getManager ( string $name ) : EntityManager Get a registered entity manager
listManagers ( ) : string[] List all registered entity managers
portTable ( string $class_name, string $source, string $destination, integer $batch_size = 100 ) Port an entire database table from one database to another
registerManager ( string $name, EntityManager $manager ) Register an entity manager
setLogger ( Psr\Log\LoggerInterface $logger ) : null Sets a logger instance on the object

Method Details

__construct() public method

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

getManager() public method

Get a registered entity manager
public getManager ( string $name ) : EntityManager
$name string
return EntityManager

listManagers() public method

List all registered entity managers
public listManagers ( ) : string[]
return string[]

portTable() public method

Port an entire database table from one database to another
public portTable ( string $class_name, string $source, string $destination, integer $batch_size = 100 )
$class_name string Fully qualified class name of entity to port
$source string Source database name set when registering managers
$destination string Target database name set when registering managers
$batch_size integer Number of entities to persist before flushing the destination manager

registerManager() public method

Register an entity manager
public registerManager ( string $name, EntityManager $manager )
$name string A short name to reference this manager during portation
$manager EntityManager Entity manager with driver to a source/target database

setLogger() public method

Sets a logger instance on the object
public setLogger ( Psr\Log\LoggerInterface $logger ) : null
$logger Psr\Log\LoggerInterface
return null

Property Details

$logger protected_oe property

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

$managers protected_oe property

protected EntityManager[],Bravo3\Orm\Services $managers
return EntityManager[]