1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 17:12:41 +00:00
Arsse/vendor/JKingWeb/NewsSync/Db/ResultSQLite3.php
J. King 6ffe942f99 SQLite3 database driver in working condition
PDO stub for now; other drivers to come
2016-10-05 22:08:43 -04:00

30 lines
No EOL
547 B
PHP

<?php
declare(strict_types=1);
namespace JKingWeb\NewsSync\Db;
class ResultSQLite3 implements Result {
protected $set;
public function __construct(\SQLite3Result $resultObj) {
$this->set = $resultObj;
}
public function __destruct() {
$this->set->finalize();
unset($this->set);
}
public function __invoke() {
return $this->get();
}
public function get() {
return $this->set->fetchArray(\SQLITE3_ASSOC);
}
public function getSingle() {
$res = $this->get();
if($res===FALSE) return null;
return array_shift($res);
}
}