1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 08:14:56 +00:00
Arsse/vendor/JKingWeb/NewsSync/Db/ResultSQLite3.php

30 lines
547 B
PHP
Raw Normal View History

<?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);
}
}