/** * Set the default fetch mode for the connection, and optional arguments for the given fetch mode. * * @param int $fetchMode * @param mixed $fetchArgument * @param array $fetchConstructorArgument * @return int * @static */ public static function setFetchMode($fetchMode, $fetchArgument = null, $fetchConstructorArgument = array()) { //Method inherited from \Illuminate\Database\Connection return \Illuminate\Database\MySqlConnection::setFetchMode($fetchMode, $fetchArgument, $fetchConstructorArgument); }
/** * Set the default fetch mode for the connection. * * @param int $fetchMode * @return int * @static */ public static function setFetchMode($fetchMode) { //Method inherited from \Illuminate\Database\Connection return \Illuminate\Database\MySqlConnection::setFetchMode($fetchMode); }
<?php use BapCat\Persist\Drivers\Local\LocalDriver; use BapCat\Phi\Phi; use BapCat\Remodel\Registry; use BapCat\Remodel\EntityDefinition; use BapCat\Session\DatabaseSessionServiceProvider; use BapCat\Session\SessionManager; use Illuminate\Database\ConnectionInterface; use Illuminate\Database\MySqlConnection; require __DIR__ . '/../vendor/autoload.php'; require __DIR__ . '/DoItUserAuthorizer.php'; $pdo = new PDO('mysql:host=localhost;dbname=test', 'root', ''); $connection = new MySqlConnection($pdo, 'test'); $connection->setFetchMode(PDO::FETCH_ASSOC); $ioc = Phi::instance(); $ioc->bind(ConnectionInterface::class, $connection); // Grab filesystem directories $persist = new LocalDriver(__DIR__ . '/..'); $cache = $persist->getDirectory('/cache'); $registry = new Registry($ioc, $cache); $sp = new DatabaseSessionServiceProvider($ioc, $registry); $sp->register(); $sp->boot(); $session = $ioc->make(SessionManager::class); $session->open(); $auth = new DoItUserAuthorizer($session);