當前位置: 首頁>>代碼示例>>PHP>>正文


PHP History::setNotes方法代碼示例

本文整理匯總了PHP中History::setNotes方法的典型用法代碼示例。如果您正苦於以下問題:PHP History::setNotes方法的具體用法?PHP History::setNotes怎麽用?PHP History::setNotes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在History的用法示例。


在下文中一共展示了History::setNotes方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Person

        $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);
        exit;
    }
}
開發者ID:CodeForEindhoven,項目名稱:uReport,代碼行數:31,代碼來源:3_tickets.php

示例2: catch

 try {
     $ticket->updateHistory($history);
 } catch (Exception $e) {
     // Any problems when creating the inspection, and we'll just not bother
     // to create it.  We're missing important information
     echo "Couldn't save inspection\n";
     echo $e->getMessage() . "\n";
     print_r($history);
     exit;
 }
 if ($row['followup_date']) {
     $history = new History();
     $history->setAction('followup');
     $history->setActionDate($row['followup_date']);
     $history->setEnteredDate($row['followup_date']);
     $history->setNotes("{$row['action_taken']}\n{$row['next_action']}");
     if ($lastPerson) {
         try {
             $history->setEnteredByPerson($lastPerson);
             $history->setActionPerson($lastPerson);
         } catch (Exception $e) {
             echo "Could not set a person for the followup\n";
             print_r($ticket);
             print_r($lastPerson);
             exit;
         }
     }
     try {
         $ticket->updateHistory($history);
     } catch (Exception $e) {
         // Anything that doesn't save, we're just going to ignore
開發者ID:CodeForEindhoven,項目名稱:uReport,代碼行數:31,代碼來源:6_tickets.php


注:本文中的History::setNotes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。