Created
June 13, 2011 16:00
-
-
Save johnkary/1023061 to your computer and use it in GitHub Desktop.
Concrete form to store widget value for "tenure_years" in key-value store
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyForm extends BaseDoctrineForm | |
{ | |
public function setup() | |
{ | |
//tenure_years, integer | |
$this->widgetSchema['tenure_years'] = new sfWidgetFormInputText(); | |
$this->validatorSchema['tenure_years'] = new sfValidatorInteger(array('required' => false)); | |
} | |
/** | |
* @see KeyValueStoreForm | |
*/ | |
protected function getObjectKeyValueStoreValues() | |
{ | |
$values = array(); | |
$values['tenure_years'] = $this->getObject()->aGet('tenure_years'); | |
return $values; | |
} | |
/** | |
* @see KeyValueStoreForm | |
*/ | |
protected function updateObjectKeyValueStoreValues(array $values) | |
{ | |
$this->getObject()->aSet('tenure_years', $values['tenure_years']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment