本文整理匯總了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;
}
示例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;
}