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


PHP Tracker_Artifact_Changeset::notify方法代碼示例

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


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

示例1: create

 /**
  * Add an artefact in the tracker
  *
  * @return Tracker_Artifact or false if an error occured
  */
 public function create(Tracker $tracker, array $fields_data, PFUser $user, $submitted_on, $send_notification)
 {
     $artifact = $this->getBareArtifact($tracker, $user, $submitted_on);
     if (!$this->fields_validator->validate($artifact, $fields_data)) {
         return;
     }
     $use_artifact_permissions = 0;
     $id = $this->artifact_dao->create($tracker->id, $user->getId(), $submitted_on, $use_artifact_permissions);
     if (!$id) {
         return;
     }
     $artifact->setId($id);
     $changeset_id = $this->changeset_creator->create($artifact, $fields_data, $user, $submitted_on);
     if (!$changeset_id) {
         return;
     }
     $changeset = new Tracker_Artifact_Changeset($changeset_id, $artifact, $artifact->getSubmittedBy(), $artifact->getSubmittedOn(), $user->getEmail());
     if ($send_notification) {
         $changeset->notify();
     }
     return $artifact;
 }
開發者ID:rinodung,項目名稱:tuleap,代碼行數:27,代碼來源:Tracker_ArtifactCreator.class.php

示例2: createArtifact

 /**
  * Add an artefact in the tracker
  * 
  * @param Tracker $tracker           The tracker this artifact belongs to
  * @param array   $fields_data       The data of the artifact to create
  * @param User    $user              The user that want to create the artifact
  * @param string  $email             The email if the user is anonymous (null if anonymous)
  * @param boolean $send_notification true if a notification must be sent, false otherwise
  * 
  * @return Tracker_Artifact or false if an error occured
  */
 public function createArtifact(Tracker $tracker, $fields_data, User $user, $email, $send_notification = true)
 {
     $artifact = $this->getInstanceFromRow(array('id' => 0, 'tracker_id' => $tracker->id, 'submitted_by' => $user->getId(), 'submitted_on' => $_SERVER['REQUEST_TIME'], 'use_artifact_permissions' => 0));
     //validate the request
     if ($ok = $artifact->validateFields($fields_data, true)) {
         //If all is ok, save the artifact
         $use_artifact_permissions = 0;
         if ($id = $this->getDao()->create($tracker->id, $user->getId(), $use_artifact_permissions)) {
             $artifact->setId($id);
             //create the first changeset
             if ($changeset_id = $artifact->createInitialChangeset($fields_data, $user, $email)) {
                 $submitted_by = $artifact->getSubmittedBy();
                 $submitted_on = $artifact->getSubmittedOn();
                 $changeset = new Tracker_Artifact_Changeset($changeset_id, $artifact, $submitted_by, $submitted_on, $email);
                 if ($send_notification) {
                     $changeset->notify();
                 }
                 return $artifact;
             }
         }
     }
     return false;
 }
開發者ID:nterray,項目名稱:tuleap,代碼行數:34,代碼來源:Tracker_ArtifactFactory.class.php


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