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/yandex.market/lib/result/ |
Upload File : |
<?php namespace Yandex\Market\Result; class Step extends Base { protected $offset; protected $progress = 0; protected $total = 0; protected $readyCount; protected $totalCount; public function setOffset($offset) { $this->offset = $offset; } public function getOffset() { return $this->offset; } public function setProgress($progress) { $this->progress = $progress; } public function increaseProgress($progress) { $this->progress += $progress; } public function getProgress() { return $this->progress; } public function setTotal($total) { $this->total = $total; } public function getTotal() { return $this->total; } public function getProgressRatio() { if ($this->readyCount !== null && $this->totalCount !== null) { $result = ($this->totalCount > 0 ? round($this->readyCount / $this->totalCount, 2) : 1); } else { $result = ($this->total > 0 ? round($this->progress / $this->total, 2) : 1); } return $result; } public function getProgressPercent() { return 100 * $this->getProgressRatio(); } public function getReadyCount() { return $this->readyCount; } public function setReadyCount($count) { $this->readyCount = (int)$count; } public function getTotalCount() { return $this->totalCount; } public function setTotalCount($count) { $this->totalCount = (int)$count; } public function isFinished() { return $this->progress >= $this->total; } }