HEX
Server: Apache
System: Linux server1.ariadata.co 4.18.0-553.120.1.el8_10.x86_64 #1 SMP Mon Apr 20 18:04:27 EDT 2026 x86_64
User: nepi (1051)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,show_source,popen,proc_open
Upload Files
File: /home/nepi/public_html/src/core/Directus/Database/Repositories/AbstractRepository.php
<?php

namespace Directus\Database\Repositories;

use Directus\Database\TableGateway\BaseTableGateway;
use Directus\Hook\Emitter;
use Directus\Permissions\Acl;
use Directus\Util\ArrayUtils;

abstract class AbstractRepository implements RepositoryInterface
{
    /**
     * TODO: We should implement compound primary key
     *
     * @var string
     */
    protected $idAttribute;

    /**
     * @var BaseTableGateway
     */
    protected $tableGateway;

    /**
     * @var Emitter
     */
    protected $hookEmitter;

    /**
     * @var Acl
     */
    protected $acl;

    public function __construct(BaseTableGateway $tableGateway, array $options = [])
    {
        $this->tableGateway = $tableGateway;
        $this->idAttribute = ArrayUtils::get($options, 'id', 'id');
        $this->hookEmitter = ArrayUtils::get($options, 'hookEmitter');
        $this->acl = ArrayUtils::get($options, 'acl');
    }

    /**
     * @param string $attribute
     * @param mixed $value
     * @return mixed
     */
    public function findOneBy($attribute, $value)
    {
        // TODO: Implement findOneBy() method.
    }

    /**
     * @param int|string $id
     * @return mixed
     */
    public function find($id)
    {
        return $this->findOneBy($this->idAttribute, $id);
    }
}