admin.aprsto/htdocs/includes/repositories/senderrepository.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
954 B
PHP

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