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/cartforge.co/app/code/Amasty/MWishlist/ViewModel/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/cartforge.co/app/code/Amasty/MWishlist/ViewModel/Pagination.php
<?php

declare(strict_types=1);

/**
 * @author Amasty Team
 * @copyright Copyright (c) Amasty (https://www.amasty.com)
 * @package Multiple Wishlist for Magento 2
 */

namespace Amasty\MWishlist\ViewModel;

use Amasty\MWishlist\Model\ConfigProvider;
use Amasty\MWishlist\Model\Source\ListType as ListTypeSource;
use Magento\Framework\View\Element\Block\ArgumentInterface;

class Pagination implements ArgumentInterface
{
    public const PAGE_VAR_NAME = 'p';
    public const LIMIT_VAR_NAME = 'limit';

    /**
     * @var ConfigProvider
     */
    private $configProvider;

    /**
     * @var ListTypeSource
     */
    private $listTypeSource;

    public function __construct(
        ConfigProvider $configProvider,
        ListTypeSource $listTypeSource
    ) {
        $this->configProvider = $configProvider;
        $this->listTypeSource = $listTypeSource;
    }

    /**
     * @return mixed
     */
    public function getPaginationFrame()
    {
        return $this->configProvider->getPaginationFrame();
    }

    /**
     * @return mixed
     */
    public function getPaginationFrameSkip()
    {
        return $this->configProvider->getPaginationFrameSkip();
    }

    /**
     * Retrieve first letter from type name.
     *
     * @param int $type
     * @return string
     */
    public function getPagerSuffix(int $type): string
    {
        $typeName = (string) $this->listTypeSource->toArray()[$type];

        return strtolower(mb_substr($typeName, 0, 1, "UTF-8"));
    }

    public function getPageVarName(int $type): string
    {
        return static::PAGE_VAR_NAME . $this->getPagerSuffix($type);
    }

    public function getLimitVarName(int $type): string
    {
        return static::LIMIT_VAR_NAME . $this->getPagerSuffix($type);
    }
}

Spamworldpro Mini