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/cvetdv.ru/bitrix/modules/landing/lib/ |
Upload File : |
<?php namespace Bitrix\Landing; class PublicActionResult { /** * Instance of Error. * @var \Bitrix\Landing\Error */ protected $error = null; /** * Result of Public Action. * @var mixed */ protected $result = null; /** * Constructor. */ public function __construct() { $this->error = new Error; } /** * Result is success. * @return boolean */ public function isSuccess() { return $this->error->isEmpty(); } /** * Set Error of Public Action. * @param \Bitrix\Landing\Error $error Error. * @return void */ public function setError(\Bitrix\Landing\Error $error) { $this->error->copyError($error); } /** * Get error collection * @return \Bitrix\Landing\Error */ public function getError() { return $this->error; } /** * Set some result of Public Action. * @param mixed $result Some result. * @return void */ public function setResult($result) { $this->result = $result; } /** * Get result of Public Action. * @return mixed */ public function getResult() { return $this->result; } /** * Sanitizes data's keys, if data is array. * @param mixed $data Some data. * @param bool $sanitizeValue Sanitize value of key too. * @return mixed */ public function sanitizeKeys($data, $sanitizeValue = false) { if (is_array($data)) { foreach ($data as $key => $value) { if ( mb_strpos($key, '.') !== false || mb_strtolower($key) == 'runtime' || $sanitizeValue && mb_strpos($value, '.') !== false ) { unset($data[$key]); } else { $data[$key] = $this->sanitizeKeys( $value, mb_strtolower($key) == 'select' ); } } } return $data; } }