2008-09-29 05:18:23 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Data received from a UserDefinedForm submission
|
2009-04-15 06:23:43 +02:00
|
|
|
*
|
|
|
|
* @package userforms
|
2008-09-29 05:18:23 +02:00
|
|
|
*/
|
2009-12-07 03:04:20 +01:00
|
|
|
|
2008-09-29 05:18:23 +02:00
|
|
|
class SubmittedFormField extends DataObject {
|
|
|
|
|
|
|
|
static $db = array(
|
|
|
|
"Name" => "Varchar",
|
|
|
|
"Value" => "Text",
|
2009-11-24 21:11:50 +01:00
|
|
|
"Title" => "Varchar(255)"
|
2008-09-29 05:18:23 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
static $has_one = array(
|
|
|
|
"Parent" => "SubmittedForm"
|
|
|
|
);
|
2010-05-16 05:55:03 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Generate a formatted value for the reports and email notifications.
|
|
|
|
* Converts new lines (which are stored in the database text field) as
|
|
|
|
* <brs> so they will output as newlines in the reports
|
|
|
|
*
|
|
|
|
* @return String
|
|
|
|
*/
|
|
|
|
function getFormattedValue() {
|
|
|
|
return nl2br($this->dbObject('Value')->RAW());
|
|
|
|
}
|
2008-09-29 05:18:23 +02:00
|
|
|
}
|