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/Services/UserSessionService.php
<?php

namespace Directus\Services;

use Directus\Application\Container;
use Directus\Database\Schema\SchemaManager;

class UserSessionService extends AbstractService
{

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

    /**
     * @var string
     */
    protected $collection;

    /**
     * @var ItemsService
     */
    protected $itemsService;

    public function __construct(Container $container)
    {
        parent::__construct($container);
        $this->collection = SchemaManager::COLLECTION_USER_SESSIONS;
    }

    /**
     * @param array $data
     *
     * @return array
     */
    public function create(array $data)
    {
        $userSessiontableGateway = $this->createTableGateway($this->collection, false);
        return $userSessiontableGateway->recordSession($data);
    }

    /**
     * @param $id
     * @param array $data
     *
     * @return array
     */
    public function update($id,array $data)
    {
        $userSessiontableGateway = $this->createTableGateway($this->collection, false);
        return $userSessiontableGateway->updateSession($id,$data);
    }
   
    /**
     * @param array $conditions
     *
     * @return string
     * 
     */
    public function findAll($conditions)
    {
        return $this->getItemsAndSetResponseCacheTags($this->createTableGateway($this->collection,false), $conditions);
    }
   
    /**
     * @param array $conditions
     *
     * @return string
     * 
     */
    public function find($conditions)
    {
        $userSessiontableGateway = $this->createTableGateway($this->collection, false);
        $response = $userSessiontableGateway->fetchSession($conditions);
        return $response ? $response->toArray() : $response;
    }

    /**
     * @param $conditions
     *
     */
    public function destroy($conditions)
    {
        $userSessionTable = $this->createTableGateway(SchemaManager::COLLECTION_USER_SESSIONS, false);
        $userSessionTable->delete($conditions);
        return true;
    }
}