Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/zendesk/zendesk_api_client_php/src/Zendesk/API/Resources/Core/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/zendesk/zendesk_api_client_php/src/Zendesk/API/Resources/Core/Requests.php
<?php

namespace Zendesk\API\Resources\Core;

use Zendesk\API\Resources\ResourceAbstract;
use Zendesk\API\Traits\Resource\Defaults;
use Zendesk\API\Traits\Utility\InstantiatorTrait;

/**
 * The Requests class exposes request management methods
 *
 * @method RequestComments comments()
 */
class Requests extends ResourceAbstract
{
    use InstantiatorTrait;

    use Defaults;

    /**
     * {@inheritdoc}
     */
    protected function setUpRoutes()
    {
        $this->setRoutes([
            'findAllOpen'   => "{$this->resourceName}/open.json",
            'findAllSolved' => "{$this->resourceName}/solved.json",
            'findAllCCd'    => "{$this->resourceName}/ccd.json",
            'search'        => "{$this->resourceName}/search.json",
        ]);
    }

    /**
     * {@inheritdoc}
     */
    public static function getValidSubResources()
    {
        return [
            'comments' => RequestComments::class,
        ];
    }

    /**
     * {$@inheritdoc}
     */
    public function getRoute($name, array $params = [])
    {
        $lastChained = $this->getLatestChainedParameter([self::class]);

        if ((empty($lastChained)) || ! (in_array($name, ['findAll']))) {
            return parent::getRoute($name, $params);
        }

        $chainedResourceId    = reset($lastChained);
        $chainedResourceNames = array_keys($lastChained);
        $chainedResourceName  = (new $chainedResourceNames[0]($this->client))->resourceName;

        if ($name === 'findAll') {
            if (in_array($chainedResourceName, ['users', 'organizations'])) {
                return "{$chainedResourceName}/{$chainedResourceId}/{$this->resourceName}.json";
            }

            return "{$this->resourceName}.json";
        }
    }

    /**
     * Find all open requests
     *
     * @param array $params
     *
     * @return \stdClass | null
     */
    public function findAllOpen(array $params = [])
    {
        return $this->findAll($params, __FUNCTION__);
    }

    /**
     * Find all open requests
     *
     * @param array $params
     *
     * @return \stdClass | null
     */
    public function findAllSolved(array $params = [])
    {
        return $this->findAll($params, __FUNCTION__);
    }

    /**
     * Find all open requests
     *
     * @param array $params
     *
     * @return \stdClass | null
     */
    public function findAllCCd(array $params = [])
    {
        return $this->findAll($params, __FUNCTION__);
    }

    /**
     * Searching requests
     *
     * @param array $queryParams
     *
     * @return \stdClass | null
     */
    public function search(array $queryParams)
    {
        return $this->client->get($this->getRoute(__FUNCTION__), $queryParams);
    }
}

Spamworldpro Mini