/**
  * @param SqliteConfig $sqliteConfig
  */
 public function __construct(SqliteConfig $sqliteConfig)
 {
     $this->sqliteConfig = $sqliteConfig;
     $this->pdo = SqlitePDORegistry::getInstance($this->sqliteConfig->dbPath());
 }
Beispiel #2
0
 /**
  * @return PhotoThumbRepository
  */
 public function getPhotoThumbRepository()
 {
     switch ($this->repository->driver()) {
         case Repository::REPOSITORY_SQLITE:
             return new SqlitePhotoThumbRepository(SqliteConfig::getInstanceByArray($this->repository->config()));
             break;
         case Repository::REPOSITORY_MYSQL:
             return new MysqlPhotoThumbRepository(MysqlConfig::getInstanceByArray($this->repository->config()));
             break;
         default:
             throw new \InvalidArgumentException(sprintf('Invalid repo driver "%s"', $this->repository->driver()));
             break;
     }
 }