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/module-backend/Model/Dashboard/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/magento/module-backend/Model/Dashboard/Period.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Magento\Backend\Model\Dashboard;

/**
 * Dashboard period info retriever
 */
class Period
{
    public const PERIOD_TODAY = 'today';
    public const PERIOD_24_HOURS = '24h';
    public const PERIOD_7_DAYS = '7d';
    public const PERIOD_1_MONTH = '1m';
    public const PERIOD_1_YEAR = '1y';
    public const PERIOD_2_YEARS = '2y';

    private const PERIOD_UNIT_HOUR = 'hour';
    private const PERIOD_UNIT_DAY = 'day';
    private const PERIOD_UNIT_MONTH = 'month';

    /**
     * Prepare array with periods for dashboard graphs
     *
     * @return array
     */
    public function getDatePeriods(): array
    {
        return [
            static::PERIOD_TODAY => __('Today'),
            static::PERIOD_24_HOURS => __('Last 24 Hours'),
            static::PERIOD_7_DAYS => __('Last 7 Days'),
            static::PERIOD_1_MONTH => __('Current Month'),
            static::PERIOD_1_YEAR => __('YTD'),
            static::PERIOD_2_YEARS => __('2YTD')
        ];
    }

    /**
     * Prepare array with periods mapping to chart units
     *
     * @return array
     */
    public function getPeriodChartUnits(): array
    {
        return [
            static::PERIOD_TODAY => self::PERIOD_UNIT_HOUR,
            static::PERIOD_24_HOURS => self::PERIOD_UNIT_HOUR,
            static::PERIOD_7_DAYS => self::PERIOD_UNIT_DAY,
            static::PERIOD_1_MONTH => self::PERIOD_UNIT_DAY,
            static::PERIOD_1_YEAR => self::PERIOD_UNIT_MONTH,
            static::PERIOD_2_YEARS => self::PERIOD_UNIT_MONTH
        ];
    }
}

Spamworldpro Mini