当前位置: 首页>>代码示例>>PHP>>正文


PHP CAgent::Delete方法代码示例

本文整理汇总了PHP中CAgent::Delete方法的典型用法代码示例。如果您正苦于以下问题:PHP CAgent::Delete方法的具体用法?PHP CAgent::Delete怎么用?PHP CAgent::Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CAgent的用法示例。


在下文中一共展示了CAgent::Delete方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actualizeAgent

 /**
  * @param null $mailingId
  * @param null $mailingChainId
  * @throws \Bitrix\Main\ArgumentException
  */
 public static function actualizeAgent($mailingId = null, $mailingChainId = null)
 {
     $agent = new \CAgent();
     $isSendByTimeMethodCron = \COption::GetOptionInt("sender", "auto_method") === 'cron';
     $arFilter = array();
     if ($mailingId) {
         $arFilter['=MAILING_ID'] = $mailingId;
     }
     if ($mailingChainId) {
         $arFilter['=ID'] = $mailingChainId;
     }
     $mailingChainDb = MailingChainTable::getList(array('select' => array('ID', 'STATUS', 'AUTO_SEND_TIME', 'MAILING_ACTIVE' => 'MAILING.ACTIVE'), 'filter' => $arFilter));
     while ($mailingChain = $mailingChainDb->fetch()) {
         $agentName = static::getAgentName($mailingChain['ID']);
         $rsAgents = $agent->GetList(array("ID" => "DESC"), array("MODULE_ID" => "sender", "NAME" => $agentName));
         while ($arAgent = $rsAgents->Fetch()) {
             $agent->Delete($arAgent["ID"]);
         }
         if ($isSendByTimeMethodCron || $mailingChain['REITERATE'] != 'Y' && empty($mailingChain['AUTO_SEND_TIME'])) {
             continue;
         }
         if ($mailingChain['MAILING_ACTIVE'] == 'Y' && $mailingChain['STATUS'] == MailingChainTable::STATUS_SEND) {
             if (!empty($mailingChain['AUTO_SEND_TIME'])) {
                 $dateExecute = $mailingChain['AUTO_SEND_TIME'];
             } else {
                 $dateExecute = "";
             }
             $agent->AddAgent($agentName, "sender", "N", 0, null, "Y", $dateExecute);
         }
     }
 }
开发者ID:akniyev,项目名称:arteva.ru,代码行数:36,代码来源:mailingmanager.php

示例2: array

    if ($_REQUEST['action_target'] == 'selected') {
        $arID = array();
        $rsData = CAgent::GetList(array($by => $order), $arFilter);
        while ($arRes = $rsData->Fetch()) {
            $arID[] = $arRes['ID'];
        }
    }
    foreach ($arID as $ID) {
        $ID = IntVal($ID);
        if ($ID <= 0) {
            continue;
        }
        switch ($_REQUEST['action']) {
            case "delete":
                @set_time_limit(0);
                if (!CAgent::Delete($ID)) {
                    $lAdmin->AddGroupError(GetMessage("DELETE_ERROR"), $ID);
                }
                break;
            case "activate":
                CAgent::Update($ID, array("ACTIVE" => "Y"));
                break;
            case "deactivate":
                CAgent::Update($ID, array("ACTIVE" => "N"));
                break;
        }
    }
}
$agentList = CAgent::GetList(array($by => $order), $arFilter);
$rsData = new CAdminResult($agentList, $sTableID);
$rsData->NavStart(20);
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:agent_list.php

示例3: switch

        switch ($_REQUEST['action']) {
            case "delete":
                @set_time_limit(0);
                $DB->StartTransaction();
                if (!CPosting::Delete($ID)) {
                    $DB->Rollback();
                    $lAdmin->AddGroupError(GetMessage("post_del_err"), $ID);
                }
                $DB->Commit();
                break;
            case "stop":
                $cPosting = new CPosting();
                $cPosting->ChangeStatus($ID, "W");
                $rsAgents = CAgent::GetList(array("ID" => "DESC"), array("MODULE_ID" => "subscribe", "NAME" => "CPosting::AutoSend(" . $ID . ",%"));
                while ($arAgent = $rsAgents->Fetch()) {
                    CAgent::Delete($arAgent["ID"]);
                }
                break;
        }
    }
}
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "id", "align" => "right", "default" => true), array("id" => "TIMESTAMP_X", "content" => GetMessage("post_updated"), "sort" => "timestamp", "default" => true), array("id" => "SUBJECT", "content" => GetMessage("post_subj"), "sort" => "subject", "default" => true), array("id" => "BODY_TYPE", "content" => GetMessage("post_body_type"), "sort" => "body_type", "default" => true), array("id" => "STATUS", "content" => GetMessage("post_stat"), "sort" => "status", "default" => true), array("id" => "DATE_SENT", "content" => GetMessage("post_sent"), "sort" => "date_sent", "default" => true), array("id" => "SENT_TO", "content" => GetMessage("post_report"), "sort" => false, "default" => false), array("id" => "FROM_FIELD", "content" => GetMessage("post_from"), "sort" => "from_field", "default" => false), array("id" => "TO_FIELD", "content" => GetMessage("post_to"), "sort" => "to_field", "default" => false)));
$cData = new CPosting();
$rsData = $cData->GetList(array($by => $order), $arFilter);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("post_nav")));
while ($arRes = $rsData->NavNext(true, "f_")) {
    $row =& $lAdmin->AddRow($f_ID, $arRes);
    $row->AddViewField("SUBJECT", '<a href="posting_edit.php?ID=' . $f_ID . '&amp;lang=' . LANG . '" title="' . GetMessage("post_act_edit") . '">' . $f_SUBJECT . '</a>');
    $row->AddInputField("SUBJECT", array("size" => 20));
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:posting_admin.php

示例4: actualizeHandlers

 public static function actualizeHandlers($chainId, array $fieldsNew = null, array $fieldsOld = null)
 {
     $settingsNew = null;
     $settingsOld = null;
     if ($fieldsNew) {
         $settingsNew = new TriggerSettings($fieldsNew);
     }
     if ($fieldsOld) {
         $settingsOld = new TriggerSettings($fieldsOld);
     }
     // if old item was closed trigger
     if ($settingsOld && $settingsOld->isClosedTrigger()) {
         // delete agent
         $agentName = TriggerManager::getClosedEventAgentName($settingsOld->getEventModuleId(), $settingsOld->getEventType(), $chainId);
         $agent = new \CAgent();
         $agentListDb = $agent->GetList(array(), array('MODULE_ID' => 'sender', 'NAME' => $agentName));
         while ($agentItem = $agentListDb->Fetch()) {
             $agent->Delete($agentItem['ID']);
         }
     }
     // if new item is closed trigger
     if ($settingsNew && $settingsNew->isClosedTrigger()) {
         // check active state of mailing
         $chainDb = MailingChainTable::getList(array('select' => array('ID'), 'filter' => array('=ID' => $chainId, '=MAILING.ACTIVE' => 'Y')));
         if (!$chainDb->fetch()) {
             return;
         }
         // add new agent
         $agentName = TriggerManager::getClosedEventAgentName($settingsNew->getEventModuleId(), $settingsNew->getEventType(), $chainId);
         // set date of next exec
         $agentTime = $settingsNew->getClosedTriggerTime();
         $agentInterval = $settingsNew->getClosedTriggerInterval();
         if ($agentInterval <= 0) {
             $agentInterval = 1440;
         }
         $agentTimeArray = explode(":", $agentTime);
         $agentDate = new \Bitrix\Main\Type\DateTime();
         $agentDate->setTime((int) $agentTimeArray[0], (int) $agentTimeArray[1]);
         // set next exec on next day if exec was today
         if ($agentDate->getTimestamp() < time()) {
             $agentDate->add("1 days");
         }
         // add agent
         $agent = new \CAgent();
         $agent->AddAgent($agentName, 'sender', 'N', $agentInterval * 60, '', 'Y', $agentDate->toString());
         return;
     }
     // actualize deleted/changed event
     if ($settingsOld && !$settingsOld->isClosedTrigger() && $settingsOld->getFullEventType()) {
         // if delete operation(no the NEW)
         // or change operation(the NEW is not equal to the OLD)
         if (!$settingsNew || $settingsOld->getFullEventType() != $settingsNew->getFullEventType()) {
             TriggerManager::actualizeHandler(array('MODULE_ID' => $settingsOld->getEventModuleId(), 'EVENT_TYPE' => $settingsOld->getEventType(), 'CALLED_BEFORE_CHANGE' => true));
         }
     }
     // actualize new event
     if ($settingsNew && $settingsNew->getFullEventType()) {
         $calledBeforeChange = $fieldsOld ? false : true;
         TriggerManager::actualizeHandler(array('MODULE_ID' => $settingsNew->getEventModuleId(), 'EVENT_TYPE' => $settingsNew->getEventType(), 'CALLED_BEFORE_CHANGE' => $calledBeforeChange));
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:61,代码来源:mailingtrigger.php

示例5: Delete

 public function Delete($ID)
 {
     global $DB;
     CModule::IncludeModule("main");
     $ID = intval($ID);
     // ”дал¤ем агент
     $arAgent = CAgent::GetList(array(), array("NAME" => "CAcritExport::StartAgent(" . $ID . ");"))->Fetch();
     CAgent::Delete($arAgent["ID"]);
     $DB->StartTransaction();
     $res = $DB->Query("DELETE FROM " . $this->tableName . " WHERE ID='" . $ID . "'", false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     if ($res) {
         $DB->Commit();
     } else {
         $DB->Rollback();
     }
     return $res;
 }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:17,代码来源:cexportproprofiledb.php

示例6: update

 /**
  * Update agent's params.
  * @param string $siteId Site id.
  * @param array $feedSettings Feed settings.
  * @return array Feed settings with renew agents ids.
  */
 public static function update($siteId, array $feedSettings)
 {
     foreach ($feedSettings as $feedType => $feedParams) {
         $interval = intval($feedParams["INTERVAL"]);
         $dbRes = \CAgent::GetList(array(), array('NAME' => self::createAgentNameForAdd($feedType, $siteId)));
         if ($agent = $dbRes->Fetch()) {
             if ($interval <= 0) {
                 \CAgent::Delete($agent["ID"]);
                 $feedSettings[$feedType]["AGENT_ID"] = 0;
                 continue;
             }
             \CAgent::Update($agent["ID"], array('AGENT_INTERVAL' => $interval * 60));
             $feedSettings[$feedType]["AGENT_ID"] = $agent["ID"];
         } else {
             $feedSettings[$feedType]["AGENT_ID"] = self::add($feedType, $siteId, $feedParams["INTERVAL"]);
         }
     }
     return $feedSettings;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:25,代码来源:agent.php

示例7: UnSubscribeOnTime

 public function UnSubscribeOnTime($id)
 {
     CAgent::Delete($id);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:4,代码来源:schedulerservice.php


注:本文中的CAgent::Delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。