mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-06-16 09:01:31 +02:00
33 lines
667 B
PHP
33 lines
667 B
PHP
<?php
|
|
|
|
namespace A2nt\CMSNiceties\Extensions;
|
|
|
|
use SilverStripe\ORM\DataExtension;
|
|
|
|
/**
|
|
* Class \A2nt\CMSNiceties\Extensions\SubmittedFormEx
|
|
*
|
|
* @property \A2nt\CMSNiceties\Extensions\SubmittedFormEx $owner
|
|
*/
|
|
class SubmittedFormEx extends DataExtension
|
|
{
|
|
public function Title()
|
|
{
|
|
$obj = $this->owner;
|
|
$parent = $obj->Parent();
|
|
|
|
$title = '#' . $obj->ID;
|
|
|
|
if(!$parent) {
|
|
return $title;
|
|
}
|
|
|
|
$cols = $parent->SubmissionColumns();
|
|
foreach ($cols as $col) {
|
|
$name = $col->getField('Name');
|
|
$title .= ' '.$obj->relField($name);
|
|
}
|
|
|
|
return $title;
|
|
}
|
|
} |