<?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 daita\MySmallPhpTools\Exceptions\DateTimeException;
use DateInterval;
use DateTime;
use Doctrine\DBAL\Query\QueryBuilder;
use Exception;
use OC;
use OC\DB\SchemaWrapper;
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\ILogger;
use OCP\IURLGenerator;
/**
* Class CoreRequestBuilder
*
* @package OCA\Social\Db
*/
class CoreRequestBuilder {
const TABLE_REQUEST_QUEUE = 'social_3_req_queue';
const TABLE_INSTANCE = 'social_3_instance';
const TABLE_ACTORS = 'social_3_actor';
const TABLE_STREAM = 'social_3_stream';
const TABLE_STREAM_DEST = 'social_3_stream_dest';
const TABLE_STREAM_TAGS = 'social_3_stream_tag';
const TABLE_STREAM_QUEUE = 'social_3_stream_queue';
const TABLE_STREAM_ACTIONS = 'social_3_stream_act';
const TABLE_HASHTAGS = 'social_3_hashtag';
const TABLE_FOLLOWS = 'social_3_follow';
const TABLE_ACTIONS = 'social_3_action';
const TABLE_CACHE_ACTORS = 'social_3_cache_actor';
const TABLE_CACHE_DOCUMENTS = 'social_3_cache_doc';
const TABLE_CLIENT = 'social_3_client';
const TABLE_CLIENT_AUTH = 'social_3_client_auth';
const TABLE_CLIENT_TOKEN = 'social_3_client_token';
/** @var array */
private $tables = [
self::TABLE_REQUEST_QUEUE,
self::TABLE_ACTORS,
self: