2008-09-29 03:18:23 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Data received from a UserDefinedForm submission
|
2009-04-15 04:23:43 +00:00
|
|
|
*
|
|
|
|
* @package userforms
|
2008-09-29 03:18:23 +00:00
|
|
|
*/
|
2009-12-07 02:04:20 +00:00
|
|
|
|
2008-09-29 03:18:23 +00:00
|
|
|
class SubmittedFormField extends DataObject {
|
|
|
|
|
|
|
|
static $db = array(
|
|
|
|
"Name" => "Varchar",
|
|
|
|
"Value" => "Text",
|
2009-11-24 20:11:50 +00:00
|
|
|
"Title" => "Varchar(255)"
|
2008-09-29 03:18:23 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
static $has_one = array(
|
|
|
|
"Parent" => "SubmittedForm"
|
|
|
|
);
|
2010-05-16 03:55:03 +00: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 03:18:23 +00:00
|
|
|
}
|