mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-23 09:02:41 +00:00
30 lines
547 B
PHP
30 lines
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);
|
||
|
}
|
||
|
}
|