This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/core/imageboard/search.php

49 lines
817 B
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
namespace Shimmie2;
class Querylet
{
2022-10-28 00:45:35 +00:00
public function __construct(
public string $sql,
2023-11-11 21:49:12 +00:00
public array $variables = [],
2022-10-28 00:45:35 +00:00
) {
}
2019-05-29 17:23:29 +00:00
public function append(Querylet $querylet): void
{
$this->sql .= $querylet->sql;
$this->variables = array_merge($this->variables, $querylet->variables);
}
2019-05-29 17:23:29 +00:00
public function append_sql(string $sql): void
{
$this->sql .= $sql;
}
2019-05-29 17:23:29 +00:00
public function add_variable($var): void
{
$this->variables[] = $var;
}
}
class TagCondition
{
2022-10-28 00:45:35 +00:00
public function __construct(
public string $tag,
public bool $positive,
) {
}
}
class ImgCondition
{
2022-10-28 00:45:35 +00:00
public function __construct(
public Querylet $qlet,
public bool $positive,
) {
}
}