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/search/ |
Upload File : |
<?php namespace Bitrix\Main\Search; final class ResultLimit implements \JsonSerializable { /** @var string */ private $type; /** @var string */ private $title; /** @var string */ private $description; /** @var array */ private $buttons = []; public function __construct($type, $title, $description = null) { $this ->setType($type) ->setTitle($title) ->setDescription($description) ; } /** * Returns the element type. For example: lead, deal, file, folder, etc. * * @return string|null */ public function getType() { return $this->type; } /** * Sets the element type. For example: lead, deal, file, folder, etc. * @param string $type * * @return $this */ public function setType($type) { $this->type = $type; return $this; } /** * Returns the limit title * * @return string */ public function getTitle() { return $this->title; } /** * Sets the limit title * * @param $title * * @return $this */ public function setTitle($title) { if (is_string($title)) { $this->title = $title; } return $this; } /** * Return the limit description * * @return string|null */ public function getDescription() { return $this->description; } /** * Sets the limit description * * @param $description * * @return $this */ public function setDescription($description) { if (is_string($description)) { $this->description = $description; } return $this; } /** * Gets the limit buttons * * @return array */ public function getButtons() { return $this->buttons; } /** * Sets the limit buttons * * @param $buttons * * @return $this */ public function setButtons($buttons) { if (is_array($buttons)) { foreach ($buttons as $button) { if (is_string($button)) { $this->buttons[] = $button; } } } return $this; } /** * Specify data which should be serialized to JSON * @link https://php.net/manual/en/jsonserializable.jsonserialize.php * @return mixed data which can be serialized by <b>json_encode</b>, * which is a value of any type other than a resource. * @since 5.4.0 */ public function jsonSerialize(): array { return [ "type" => $this->getType(), "title" => $this->getTitle(), "description" => $this->getDescription(), "buttons" => $this->getButtons(), ]; } }