本文整理汇总了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;
}