
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 0.62 KB | hits: 10 | expires: Never
<?php
class TnlExpenseCommentForm extends BaseTnlExpenseCommentForm
{
public function configure()
{
$this->useFields(array('body'));
$this->widgetSchema->setHelp('body' ,'Please enter a comment regarding to the expense.');
$this->widgetSchema->setLabel('body', 'Comment');
$this->validatorSchema['body']->setOption('required', false);
}
public function updateObject($values = null)
{
$comment = parent::updateObject($values);
if ($comment->isNew())
{
$comment->setCreatedBy($this->getOption('user')->getGuardUser()->getId());
}
return $comment;
}
}