<?php
declare(strict_types=1);
/**
* Nextcloud - Social Support
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2018, Maxence Lange <maxence@artificial-owl.com>
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Social\Db;
use OCA\Social\Tools\Exceptions\DateTimeException;
use DateInterval;
use DateTime;
use Doctrine\DBAL\Query\QueryBuilder;
use Exception;
use OC;
use OC\DB\SchemaWrapper;
use OCP\DB\ISchemaWrapper;
use OCA\Social\Exceptions\InvalidResourceException;
use OCA\Social\Model\ActivityPub\Actor\Person;
use OCA\Social\Model\ActivityPub\Object\Follow;
use OCA\Social\Model\StreamAction;
use OCA\Social\Service\ConfigService;
use OCA\Social\Service\MiscService;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\IURLGenerator;
use Psr\Log\LoggerInterface;
/**
* Class CoreRequestBuilder
*
* @package OCA\Social\Db
*/
class CoreRequestBuilder {
public const TABLE_REQUEST_QUEUE = 'social_3_req_queue';
public const TABLE_INSTANCE = 'social_3_instance';
public const TABLE_ACTORS = 'social_3_actor';
public const TABLE_STREAM = 'social_3_stream';
public const TABLE_STREAM_DEST = 'social_3_stream_dest';
public const TABLE_STREAM_TAGS = 'social_3_stream_tag';
public const TABLE_STREAM_QUEUE = 'social_3_stream_queue';
public const TABLE_STREAM_ACTIONS = 'social_3_stream_act';
public const TABLE_HASHTAGS = 'social_3_hashtag';
public const TABLE_FOLLOWS = 'social_3_follow';
public const TABLE_ACTIONS = 'social_3_action';
public const TABLE_CACHE_ACTORS = 'social_3_cache_actor';
public const TABLE_CACHE_DOCUMENTS = 'social_3_cache_doc';
public const TABLE_CLIENT = 'social_3_client';
public const TABLE_CLIENT_AUTH = 'social_3_client_auth';
public const TABLE_CLIENT_TOKEN = 'social_3_client_token';
private array $tables = [
self::TABLE_REQUEST_QUEUE,
self::TABLE_ACTORS,
self::TABLE_STREAM,
self::TABLE_HASHTAGS,
self::TABLE_FOLLOWS,
self::TABLE_ACTIONS,
self::TABLE_CACHE_ACTORS,
self::TABLE_CACHE_DOCUMENTS,
self::TABLE_STREAM_QUEUE,
self::TABLE_STREAM_DEST,
self::TABLE_STREAM_TAGS,
self::TABLE_STREAM_ACTIONS,
self::TABLE_CLIENT,
self::TABLE_CLIENT_AUTH,
self::TABLE_CLIENT_TOKEN
];
protected LoggerInterface $logger;
protected IURLGenerator $urlGen