uawdijnntqw1x1x1
IP : 3.17.65.43
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
samara.axolotls.ru
/
bitrix
/
modules
/
tasks
/
lib
/
util
/
type
/
arrayoption.php
/
/
<? namespace Bitrix\Tasks\Util\Type; use Bitrix\Tasks\Util\User; use Bitrix\Tasks\Util; use Bitrix\Tasks\Util\Type\StructureChecker; class ArrayOption { protected $optionName = ''; protected $rules = array(); protected $type = null; protected $checker = null; const TYPE_USER = 1; const TYPE_GLOBAL = 2; public function __construct($optionName = '', $rules = array(), $type = null) { $this->optionName = trim((string) $optionName); if(is_array($rules)) { $this->rules = $rules; } if($type !== null) { $this->type = $type; } else { $this->type = static::TYPE_USER; } } /** * @throws \Bitrix\Main\NotImplementedException * @return string * * @deprecated This is the default option name. Better to use from $this->optionName */ protected static function getFilterOptionName() { throw new \Bitrix\Main\NotImplementedException(); } protected function getRules() { return $this->rules; } public function setOptionName($name) { $this->optionName = $name; } public function set(array $value) { $name = $this->getOptionName(); $value = \Bitrix\Tasks\Util\Type::serializeArray($this->check($value)); if($this->type == static::TYPE_USER) { User::setOption($name, $value); } else { Util::setOption($name, $value); } } public function get() { $value = $this->check( \Bitrix\Tasks\Util\Type::unSerializeArray($this->fetchOptionValue()), !$this->checkOptionValueExists() ); return $value; } public function remove() { $name = $this->getOptionName(); if($this->type == static::TYPE_USER) { User::unSetOption($name); } else { Util::unSetOption($name); } } public function check($value, $initial = false) { // todo: use object pool here for StructureChecker if(!$this->checker) { $this->checker = new StructureChecker($this->getRules()); } return $this->checker->check($value, $initial); } public function removeForAllUsers() { $name = $this->getOptionName(); if($this->type == static::TYPE_USER) { User::unSetOptionForAll($name); } else { Util::unSetOption($name); } } protected function fetchOptionValue() { $name = $this->getOptionName(); if($this->type == static::TYPE_USER) { return User::getOption($name); } else { return Util::getOption($name); } } protected function checkOptionValueExists() { return $this->fetchOptionValue() != ''; } protected function getOptionName() { if($this->optionName != '') { return $this->optionName; } return static::getFilterOptionName(); } }
/var/www/axolotl/data/www/samara.axolotls.ru/bitrix/modules/tasks/lib/util/type/arrayoption.php