/** * Native PDO driver constructor * * @param \PDO $pdo * @param array $classmap */ public function __construct(\PDO $pdo, array $classmap = []) { parent::__construct($pdo); foreach ($classmap as $entity => $class) { $this->entities[$entity] = Mapper\Entity::of($class); $this->classmap[$class] = $entity; } }
public function __construct() { parent::__construct('mysql:host=' . TM_MYSQL_HOST . ';dbname=' . TM_MYSQL_DBNAME, TM_MYSQL_USER, TM_MYSQL_PASSWORD, array(\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_PERSISTENT => true, \PDO::MYSQL_ATTR_INIT_COMMAND => 'set names utf8mb4')); }