silverstripe-dms/tests/Stub/StubRelatedDocumentExtension.php
Robbie Averill 9c0ec616d1 NEW Relate documents to other documents
* Modularise templates, add missing localisations, add related documents to template
* Add getRelatedDocuments as an extensible getter in DMSDocument
2017-05-02 12:38:55 +12:00

19 lines
508 B
PHP

<?php
class StubRelatedDocumentExtension extends DataExtension implements TestOnly
{
/**
* Push a fixed array entry into the datalist for extensibility testing
*
* @param ArrayList $relatedDocuments
* @return ArrayList
*/
public function updateRelatedDocuments(ArrayList $relatedDocuments)
{
$fakeDocument = new DMSDocument;
$fakeDocument->Filename = 'Extended';
$relatedDocuments->push($fakeDocument);
return $relatedDocuments;
}
}