Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/main/lib/grid/ |
Upload File : |
<? namespace Bitrix\Main\Grid; /** * Class Declension * @package Bitrix\Main\Grid */ class Declension { /** * @var string */ public $oneItem; /** * @var string */ public $fourItem; /** * @var string */ public $fiveItem; /** * Declension constructor. * * @param string $one * @param string $four * @param string $five */ public function __construct($one = "", $four = "", $five = "") { $this->oneItem = $one; $this->fourItem = $four; $this->fiveItem = $five; } /** * Gets declension * @param number|string $number * @return string */ public function get($number) { $result = $this->fiveItem; $number = $number % 100; if ($number < 11 || $number > 19) { $number = $number % 10; if ($number === 1) { $result = $this->oneItem; } if ($number >= 2 && $number <= 4) { $result = $this->fourItem; } } return $result; } }