admin.aprsto/htdocs/includes/repositories/receiverrepository.class.php
Steve White ae9ece5266 *** Initial Commit of Files for APRS.TO Backend Administration Panel ***
This code is non-functional at this point.
2025-02-02 15:53:34 -05:00

47 lines
970 B
PHP

<?php
class ReceiverRepository extends ModelRepository
{
private static $_singletonInstance = null;
public function __construct()
{
parent::__construct('Receiver');
}
/**
* Returnes an initiated ReceiverRepository
*
* @return ReceiverRepository
*/
public static function getInstance()
{
if (self::$_singletonInstance === null) {
self::$_singletonInstance = new ReceiverRepository();
}
return self::$_singletonInstance;
}
/**
* Get object by id
*
* @param int $id
* @return Receiver
*/
public function getObjectById($id)
{
if (!isInt($id)) {
return new Receiver(0);
}
static $cache = array();
$key = $id;
if (!isset($cache[$key])) {
$cache[$key] = $this->getObjectFromSql('select * from receiver where id = ?', [$id]);
}
return $cache[$key];
}
}