public function __construct(RActiveRecord $record) { $this->_record = $record; $serviceContainer = \Repel\Repel::getServiceContainer(); $connection = $serviceContainer->getConnectionManager($this->_record->_DATABASE)->getConnection(); $this->PDO = $connection->PDOInstance; return $this; }
public function __construct($record = null) { $serviceContainer = \Repel\Repel::getServiceContainer(); if ($record !== null) { $key = $record->_DATABASE; } else { $key = 'primary'; } $connection = $serviceContainer->getConnectionManager($key)->getConnection(); $this->PDO = $connection->PDOInstance; $serviceContainer->setTransaction($connection->getDriver(), $this); }
public function getFormatters() { $serviceContainer = \Repel\Repel::getServiceContainer(); return $serviceContainer->getFormatters(); }