File: //proc/self/cwd/raquel/source/Models/Service.php
<?php
namespace Source\Models;
use Source\Core\Model;
/**
* Class Service
* @package Source\Models
*/
class Service extends Model
{
/**
* Service constructor.
*/
public function __construct()
{
parent::__construct("services", ["id"], ["title", "uri", "subtitle", "content"]);
}
/**
* @param null|string $terms
* @param null|string $params
* @param string $columns
* @return mixed|Model
*/
public function findByUri(string $uri, string $columns = "*"): ?Service
{
$find = $this->find("uri = :uri", "uri={$uri}", $columns);
return $find->fetch();
}
}