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/magento/framework/DB/Sql/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/magento/framework/DB/Sql/LimitExpression.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
namespace Magento\Framework\DB\Sql;

/**
 * Class LimitExpression
 */
class LimitExpression extends Expression
{
    /**
     * @var string
     */
    protected $sql;

    /**
     * @var int
     */
    protected $count;

    /**
     * @var int
     */
    protected $offset;

    /**
     * @param string $sql
     * @param int $count
     * @param int $offset
     */
    public function __construct(
        $sql,
        $count,
        $offset = 0
    ) {
        $this->sql = $sql;
        $this->count = $count;
        $this->offset =  $offset;
    }

    /**
     * @inheritdoc
     */
    public function __toString()
    {
        $sql = $this->sql;
        $count = (int)$this->count;
        if ($count <= 0) {
            /** @see Zend_Db_Adapter_Exception */
            #require_once 'Zend/Db/Adapter/Exception.php';
            throw new \Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid");
        }

        $offset = (int)$this->offset;
        if ($offset < 0) {
            /** @see Zend_Db_Adapter_Exception */
            #require_once 'Zend/Db/Adapter/Exception.php';
            throw new \Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid");
        }

        $sql .= " LIMIT $count";
        if ($offset > 0) {
            $sql .= " OFFSET $offset";
        }
        return trim($sql);
    }
}

Spamworldpro Mini