Differential D25018 Diff 57 src/applications/legalpad/engineextension/PhabricatorLegalpadSignaturesSearchEngineAttachment.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/legalpad/engineextension/PhabricatorLegalpadSignaturesSearchEngineAttachment.php
- This file was added.
<?php | |||||
final class PhabricatorLegalpadSignaturesSearchEngineAttachment | |||||
extends PhabricatorSearchEngineAttachment { | |||||
public function getAttachmentName() { | |||||
return pht('Document signers'); | |||||
} | |||||
public function getAttachmentDescription() { | |||||
return pht('Get the signer list for the project.'); | |||||
} | |||||
public function willLoadAttachmentData($query, $spec) { | |||||
$query->needSignatures(true); | |||||
} | |||||
public function getAttachmentForObject($object, $data, $spec) { | |||||
$signatures = array(); | |||||
foreach ($object->getSignatures() as $signature) { | |||||
$signatures[] = array( | |||||
'phid' => $signature->getPHID(), | |||||
'signerPHID' => $signature->getSignerPHID(), | |||||
'exemptionPHID' => $signature->getExemptionPHID(), | |||||
'isExemption' => $signature->getIsExemption(), | |||||
'signerName' => $signature->getSignerName(), | |||||
'signerEmail' => $signature->getSignerEmail(), | |||||
'documentVersion' => $signature->getDocumentVersion(), | |||||
'dateCreated' => (int)$signature->getDateCreated(), | |||||
); | |||||
} | |||||
return array( | |||||
'signatures' => $signatures, | |||||
); | |||||
} | |||||
} |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0