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


PHP History::setAction方法代码示例

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


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

示例1: Person

     $history->setActionDate($row2['date']);
     $history->setEnteredDate($row2['date']);
     $history->setNotes($row2['notes']);
     $person = new Person($row2['username']);
     $history->setEnteredByPerson($person);
     $history->setActionPerson($person);
     $ticket->updateHistory($history);
 }
 //
 // responses go in issueHistory
 //
 $sql = "select r.date as date,r.notes as notes,\n        u.username as username, c.name as contactMethod\n\t\tfrom responses r\n        left join referrals rf on r.referral_id = rf.id\n        left join users u on r.user_id = u.id\n        left join contactMethods c on r.contactMethod_id = c.id\n\t\twhere rf.request_id=" . $row['id'];
 $result2 = $pdo->query($sql);
 while ($result2 && ($row2 = $result2->fetch(PDO::FETCH_ASSOC))) {
     $history = new History();
     $history->setAction('response');
     $history->setEnteredDate($row2['date']);
     $history->setActionDate($row2['date']);
     $history->setNotes($row2['notes']);
     $person = new Person($row2['username']);
     $history->setEnteredByPerson($person);
     $history->setActionPerson($person);
     $ticket->updateHistory($history);
 }
 try {
     $ticket->save();
     echo $ticket->getId() . " {$cnt}\n";
     $cnt++;
 } catch (Exception $e) {
     echo $e->getMessage() . "\n";
     print_r($e);
开发者ID:CodeForEindhoven,项目名称:uReport,代码行数:31,代码来源:3_tickets.php

示例2: catch

             }
         }
         try {
             $ticket->updateHistory($history);
         } catch (Exception $e) {
             // Anything that doesn't save, we're just going to ignore
             // No sense bringing over bad data.
             echo "Couldn't save followup\n";
             echo $e->getMessage() . "\n";
             print_r($history);
             exit;
         }
     }
     if ($row['completed_date']) {
         $history = new History();
         $history->setAction('close');
         $history->setActionDate($row['completed_date']);
         $history->setEnteredDate($row['completed_date']);
         if ($lastPerson) {
             $history->setEnteredByPerson($lastPerson);
             $history->setActionPerson($lastPerson);
         }
         $ticket->updateHistory($history);
     }
 }
 try {
     if (!$ticket->getEnteredByPerson()) {
         $ticket->setEnteredByPerson('unknown');
     }
     if (!$ticket->getAssignedPerson()) {
         $ticket->setAssignedPerson('unknown');
开发者ID:CodeForEindhoven,项目名称:uReport,代码行数:31,代码来源:6_tickets.php


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