mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-06-28 14:49:21 +02:00
28 lines
546 B
PHP
28 lines
546 B
PHP
|
<?php
|
||
|
|
||
|
namespace A2nt\CMSNiceties\Extensions;
|
||
|
|
||
|
use SilverStripe\ORM\DataExtension;
|
||
|
|
||
|
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 .= ' '.$item->relField($name);
|
||
|
}
|
||
|
|
||
|
return $title;
|
||
|
}
|
||
|
}
|