本文整理汇总了PHP中BaseFormDoctrine::unsetAutoFields方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseFormDoctrine::unsetAutoFields方法的具体用法?PHP BaseFormDoctrine::unsetAutoFields怎么用?PHP BaseFormDoctrine::unsetAutoFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseFormDoctrine
的用法示例。
在下文中一共展示了BaseFormDoctrine::unsetAutoFields方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setup
public function setup()
{
parent::setup();
//column
if ($this->needsWidget('name')) {
$this->setWidget('name', new sfWidgetFormInputText());
$this->setValidator('name', new sfValidatorString(array('max_length' => 255)));
}
//column
if ($this->needsWidget('slug')) {
$this->setWidget('slug', new sfWidgetFormInputText());
$this->setValidator('slug', new sfValidatorString(array('max_length' => 255)));
}
//column
if ($this->needsWidget('lang')) {
$this->setWidget('lang', new sfWidgetFormInputHidden());
$this->setValidator('lang', new sfValidatorChoice(array('choices' => array($this->getObject()->get('lang')), 'empty_value' => $this->getObject()->get('lang'), 'required' => false)));
}
//one to one
if ($this->needsWidget('id')) {
$this->setWidget('id', new sfWidgetFormDmDoctrineChoice(array('multiple' => false, 'model' => 'DmTestTag', 'expanded' => false)));
$this->setValidator('id', new sfValidatorDoctrineChoice(array('multiple' => false, 'model' => 'DmTestTag', 'required' => false)));
}
$this->validatorSchema->setPostValidator(new sfValidatorDoctrineUnique(array('model' => 'DmTestTagTranslation', 'column' => array('slug'))));
$this->widgetSchema->setNameFormat('dm_test_tag_translation[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}
示例2: setup
public function setup()
{
$this->setWidgets(array('id' => new sfWidgetFormInputHidden(), 'categ_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Categ'), 'add_empty' => false)), 'user_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Author'), 'add_empty' => false)), 'image_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Image'), 'add_empty' => true)), 'file_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('File'), 'add_empty' => true)), 'date' => new sfWidgetFormDmDate(), 'created_by' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CreatedBy'), 'add_empty' => true)), 'created_at' => new sfWidgetFormDateTime(), 'updated_at' => new sfWidgetFormDateTime(), 'position' => new sfWidgetFormInputText(), 'tags_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'DmTestTag', 'expanded' => true))));
$this->setValidators(array('id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)), 'categ_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Categ'))), 'user_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Author'))), 'image_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Image'), 'required' => false)), 'file_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('File'), 'required' => false)), 'date' => new dmValidatorDate(), 'created_by' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('CreatedBy'), 'required' => false)), 'created_at' => new sfValidatorDateTime(), 'updated_at' => new sfValidatorDateTime(), 'position' => new sfValidatorInteger(array('required' => false)), 'tags_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmTestTag', 'required' => false))));
/*
* Embed Media form for image_id
*/
$this->embedForm('image_id_form', $this->createMediaFormForImageId());
unset($this['image_id']);
/*
* Embed Media form for file_id
*/
$this->embedForm('file_id_form', $this->createMediaFormForFileId());
unset($this['file_id']);
if ('embed' == sfConfig::get('dm_i18n_form')) {
$this->embedI18n(sfConfig::get('dm_i18n_cultures'));
} else {
$this->mergeI18nForm();
}
$this->widgetSchema->setNameFormat('dm_test_post[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}
示例3: setup
public function setup()
{
parent::setup();
//column
if ($this->needsWidget('id')) {
$this->setWidget('id', new sfWidgetFormInputHidden());
$this->setValidator('id', new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)));
}
//column
if ($this->needsWidget('module')) {
$this->setWidget('module', new sfWidgetFormInputText());
$this->setValidator('module', new sfValidatorString(array('max_length' => 127)));
}
//column
if ($this->needsWidget('action')) {
$this->setWidget('action', new sfWidgetFormInputText());
$this->setValidator('action', new sfValidatorString(array('max_length' => 127)));
}
//column
if ($this->needsWidget('record_id')) {
$this->setWidget('record_id', new sfWidgetFormInputText());
$this->setValidator('record_id', new sfValidatorInteger(array('required' => false)));
}
//column
if ($this->needsWidget('credentials')) {
$this->setWidget('credentials', new sfWidgetFormInputText());
$this->setValidator('credentials', new sfValidatorString(array('max_length' => 255, 'required' => false)));
}
//column
if ($this->needsWidget('lft')) {
$this->setWidget('lft', new sfWidgetFormInputText());
$this->setValidator('lft', new sfValidatorInteger(array('required' => false)));
}
//column
if ($this->needsWidget('rgt')) {
$this->setWidget('rgt', new sfWidgetFormInputText());
$this->setValidator('rgt', new sfValidatorInteger(array('required' => false)));
}
//column
if ($this->needsWidget('level')) {
$this->setWidget('level', new sfWidgetFormInputText());
$this->setValidator('level', new sfValidatorInteger(array('required' => false)));
}
$this->validatorSchema->setPostValidator(new sfValidatorDoctrineUnique(array('model' => 'DmPage', 'column' => array('module', 'action', 'record_id'))));
if ('embed' == sfConfig::get('dm_i18n_form')) {
$this->embedI18n(sfConfig::get('dm_i18n_cultures'));
} else {
$this->mergeI18nForm();
}
$this->widgetSchema->setNameFormat('dm_page[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}
示例4: setup
public function setup()
{
parent::setup();
//column
if ($this->needsWidget('id')) {
$this->setWidget('id', new sfWidgetFormInputHidden());
$this->setValidator('id', new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)));
}
//column
if ($this->needsWidget('name')) {
$this->setWidget('name', new sfWidgetFormInputText());
$this->setValidator('name', new sfValidatorString(array('max_length' => 255, 'required' => false)));
}
//column
if ($this->needsWidget('description')) {
$this->setWidget('description', new sfWidgetFormTextarea());
$this->setValidator('description', new sfValidatorString(array('max_length' => 5000, 'required' => false)));
}
//column
if ($this->needsWidget('created_at')) {
$this->setWidget('created_at', new sfWidgetFormDateTime());
$this->setValidator('created_at', new sfValidatorDateTime());
}
//column
if ($this->needsWidget('updated_at')) {
$this->setWidget('updated_at', new sfWidgetFormDateTime());
$this->setValidator('updated_at', new sfValidatorDateTime());
}
//many to many
if ($this->needsWidget('users_list')) {
$this->setWidget('users_list', new sfWidgetFormDmPaginatedDoctrineChoice(array('multiple' => true, 'model' => 'DmUser', 'expanded' => true)));
$this->setValidator('users_list', new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmUser', 'required' => false)));
}
//many to many
if ($this->needsWidget('groups_list')) {
$this->setWidget('groups_list', new sfWidgetFormDmPaginatedDoctrineChoice(array('multiple' => true, 'model' => 'DmGroup', 'expanded' => true)));
$this->setValidator('groups_list', new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmGroup', 'required' => false)));
}
//one to many
if ($this->needsWidget('dm_user_permission_list')) {
$this->setWidget('dm_user_permission_list', new sfWidgetFormDmPaginatedDoctrineChoice(array('multiple' => true, 'model' => 'DmUserPermission', 'expanded' => true)));
$this->setValidator('dm_user_permission_list', new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmUserPermission', 'required' => false)));
}
//one to many
if ($this->needsWidget('dm_group_permission_list')) {
$this->setWidget('dm_group_permission_list', new sfWidgetFormDmPaginatedDoctrineChoice(array('multiple' => true, 'model' => 'DmGroupPermission', 'expanded' => true)));
$this->setValidator('dm_group_permission_list', new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmGroupPermission', 'required' => false)));
}
$this->validatorSchema->setPostValidator(new sfValidatorDoctrineUnique(array('model' => 'DmPermission', 'column' => array('name'))));
$this->widgetSchema->setNameFormat('dm_permission[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}
示例5: setup
public function setup()
{
parent::setup();
//column
if ($this->needsWidget('id')) {
$this->setWidget('id', new sfWidgetFormInputHidden());
$this->setValidator('id', new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)));
}
//column
if ($this->needsWidget('php_class')) {
$this->setWidget('php_class', new sfWidgetFormInputText());
$this->setValidator('php_class', new sfValidatorString(array('max_length' => 127)));
}
//column
if ($this->needsWidget('name')) {
$this->setWidget('name', new sfWidgetFormInputText());
$this->setValidator('name', new sfValidatorString(array('max_length' => 255)));
}
//column
if ($this->needsWidget('description')) {
$this->setWidget('description', new sfWidgetFormTextarea());
$this->setValidator('description', new sfValidatorString(array('max_length' => 60000, 'required' => false)));
}
//column
if ($this->needsWidget('module')) {
$this->setWidget('module', new sfWidgetFormInputText());
$this->setValidator('module', new sfValidatorString(array('max_length' => 127, 'required' => false)));
}
//column
if ($this->needsWidget('action')) {
$this->setWidget('action', new sfWidgetFormInputText());
$this->setValidator('action', new sfValidatorString(array('max_length' => 127, 'required' => false)));
}
//column
if ($this->needsWidget('uri')) {
$this->setWidget('uri', new sfWidgetFormInputText());
$this->setValidator('uri', new sfValidatorString(array('max_length' => 255)));
}
//column
if ($this->needsWidget('env')) {
$this->setWidget('env', new sfWidgetFormInputText());
$this->setValidator('env', new sfValidatorString(array('max_length' => 63)));
}
//column
if ($this->needsWidget('created_at')) {
$this->setWidget('created_at', new sfWidgetFormDateTime());
$this->setValidator('created_at', new sfValidatorDateTime());
}
$this->widgetSchema->setNameFormat('dm_error[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}
示例6: setup
public function setup()
{
parent::setup();
//column
if ($this->needsWidget('id')) {
$this->setWidget('id', new sfWidgetFormInputHidden());
$this->setValidator('id', new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)));
}
//column
if ($this->needsWidget('created_at')) {
$this->setWidget('created_at', new sfWidgetFormDateTime());
$this->setValidator('created_at', new sfValidatorDateTime());
}
//column
if ($this->needsWidget('updated_at')) {
$this->setWidget('updated_at', new sfWidgetFormDateTime());
$this->setValidator('updated_at', new sfValidatorDateTime());
}
//column
if ($this->needsWidget('position')) {
$this->setWidget('position', new sfWidgetFormInputText());
$this->setValidator('position', new sfValidatorInteger(array('required' => false)));
}
//many to many
if ($this->needsWidget('categs_list')) {
$this->setWidget('categs_list', new sfWidgetFormDmPaginatedDoctrineChoice(array('multiple' => true, 'model' => 'DmTestCateg', 'expanded' => true)));
$this->setValidator('categs_list', new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmTestCateg', 'required' => false)));
}
//many to many
if ($this->needsWidget('tags_list')) {
$this->setWidget('tags_list', new sfWidgetFormDmPaginatedDoctrineChoice(array('multiple' => true, 'model' => 'DmTag', 'expanded' => true)));
$this->setValidator('tags_list', new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmTag', 'required' => false)));
}
//one to many
if ($this->needsWidget('dm_test_domain_categ_list')) {
$this->setWidget('dm_test_domain_categ_list', new sfWidgetFormDmPaginatedDoctrineChoice(array('multiple' => true, 'model' => 'DmTestDomainCateg', 'expanded' => true)));
$this->setValidator('dm_test_domain_categ_list', new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmTestDomainCateg', 'required' => false)));
}
//one to many
if ($this->needsWidget('dm_test_domain_dm_tag_list')) {
$this->setWidget('dm_test_domain_dm_tag_list', new sfWidgetFormDmPaginatedDoctrineChoice(array('multiple' => true, 'model' => 'DmTestDomainDmTag', 'expanded' => true)));
$this->setValidator('dm_test_domain_dm_tag_list', new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmTestDomainDmTag', 'required' => false)));
}
if ('embed' == sfConfig::get('dm_i18n_form')) {
$this->embedI18n(sfConfig::get('dm_i18n_cultures'));
} else {
$this->mergeI18nForm();
}
$this->widgetSchema->setNameFormat('dm_test_domain[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}
示例7: setup
public function setup()
{
parent::setup();
//column
if ($this->needsWidget('id')) {
$this->setWidget('id', new sfWidgetFormInputHidden());
$this->setValidator('id', new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)));
}
//column
if ($this->needsWidget('author')) {
$this->setWidget('author', new sfWidgetFormInputText());
$this->setValidator('author', new sfValidatorString(array('max_length' => 255, 'required' => false)));
}
//column
if ($this->needsWidget('body')) {
$this->setWidget('body', new sfWidgetFormTextarea());
$this->setValidator('body', new sfValidatorString(array('required' => false)));
}
//column
if ($this->needsWidget('is_active')) {
$this->setWidget('is_active', new sfWidgetFormInputCheckbox());
$this->setValidator('is_active', new sfValidatorBoolean(array('required' => false)));
}
//column
if ($this->needsWidget('created_at')) {
$this->setWidget('created_at', new sfWidgetFormDateTime());
$this->setValidator('created_at', new sfValidatorDateTime());
}
//column
if ($this->needsWidget('updated_at')) {
$this->setWidget('updated_at', new sfWidgetFormDateTime());
$this->setValidator('updated_at', new sfValidatorDateTime());
}
//column
if ($this->needsWidget('version')) {
$this->setWidget('version', new sfWidgetFormInputText());
$this->setValidator('version', new sfValidatorInteger(array('required' => false)));
}
//one to many
if ($this->needsWidget('version_list')) {
$this->setWidget('version_list', new sfWidgetFormDmPaginatedDoctrineChoice(array('multiple' => true, 'model' => 'DmTestCommentVersion', 'expanded' => true)));
$this->setValidator('version_list', new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmTestCommentVersion', 'required' => false)));
}
//one to one
if ($this->needsWidget('post_id')) {
$this->setWidget('post_id', new sfWidgetFormDmDoctrineChoice(array('multiple' => false, 'model' => 'DmTestPost', 'expanded' => false)));
$this->setValidator('post_id', new sfValidatorDoctrineChoice(array('multiple' => false, 'model' => 'DmTestPost', 'required' => true)));
}
$this->widgetSchema->setNameFormat('dm_test_comment[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}
示例8: setup
public function setup()
{
$this->setWidgets(array('id' => new sfWidgetFormInputHidden(), 'name' => new sfWidgetFormInputText(), 'email' => new sfWidgetFormInputText(), 'body' => new sfWidgetFormTextarea(), 'created_at' => new sfWidgetFormDateTime(), 'updated_at' => new sfWidgetFormDateTime()));
$this->setValidators(array('id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)), 'name' => new sfValidatorString(array('max_length' => 255)), 'email' => new sfValidatorString(array('max_length' => 255)), 'body' => new sfValidatorString(array('required' => false)), 'created_at' => new sfValidatorDateTime(), 'updated_at' => new sfValidatorDateTime()));
$this->widgetSchema->setNameFormat('dm_contact[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}
示例9: setup
public function setup()
{
$this->setWidgets(array('id' => new sfWidgetFormInputHidden(), 'dm_mail_template_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Template'), 'add_empty' => true)), 'subject' => new sfWidgetFormTextarea(), 'body' => new sfWidgetFormTextarea(), 'from_email' => new sfWidgetFormTextarea(), 'to_email' => new sfWidgetFormTextarea(), 'cc_email' => new sfWidgetFormTextarea(), 'bcc_email' => new sfWidgetFormTextarea(), 'reply_to_email' => new sfWidgetFormTextarea(), 'sender_email' => new sfWidgetFormTextarea(), 'strategy' => new sfWidgetFormInputText(), 'transport' => new sfWidgetFormInputText(), 'culture' => new sfWidgetFormInputText(), 'debug_string' => new sfWidgetFormTextarea(), 'created_at' => new sfWidgetFormDateTime()));
$this->setValidators(array('id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)), 'dm_mail_template_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Template'), 'required' => false)), 'subject' => new sfValidatorString(array('max_length' => 5000)), 'body' => new sfValidatorString(), 'from_email' => new sfValidatorString(array('max_length' => 5000)), 'to_email' => new sfValidatorString(array('max_length' => 5000, 'required' => false)), 'cc_email' => new sfValidatorString(array('max_length' => 5000, 'required' => false)), 'bcc_email' => new sfValidatorString(array('max_length' => 5000, 'required' => false)), 'reply_to_email' => new sfValidatorString(array('max_length' => 5000, 'required' => false)), 'sender_email' => new sfValidatorString(array('max_length' => 5000, 'required' => false)), 'strategy' => new sfValidatorString(array('max_length' => 255, 'required' => false)), 'transport' => new sfValidatorString(array('max_length' => 255, 'required' => false)), 'culture' => new sfValidatorString(array('max_length' => 16, 'required' => false)), 'debug_string' => new sfValidatorString(array('required' => false)), 'created_at' => new sfValidatorDateTime()));
$this->widgetSchema->setNameFormat('dm_sent_mail[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}
示例10: setup
public function setup()
{
$this->setWidgets(array('id' => new sfWidgetFormInputHidden(), 'dm_area_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Area'), 'add_empty' => false)), 'css_class' => new sfWidgetFormInputText(), 'width' => new sfWidgetFormInputText(), 'position' => new sfWidgetFormInputText()));
$this->setValidators(array('id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)), 'dm_area_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Area'))), 'css_class' => new sfValidatorString(array('max_length' => 255, 'required' => false)), 'width' => new sfValidatorString(array('max_length' => 15, 'required' => false)), 'position' => new sfValidatorInteger(array('required' => false))));
$this->widgetSchema->setNameFormat('dm_zone[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}
示例11: setup
public function setup()
{
$this->setWidgets(array('id' => new sfWidgetFormInputHidden(), 'title' => new sfWidgetFormInputText(), 'created_by' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CreatedBy'), 'add_empty' => true)), 'updated_by' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('UpdatedBy'), 'add_empty' => true)), 'tags_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'DmTag', 'expanded' => true))));
$this->setValidators(array('id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)), 'title' => new sfValidatorString(array('max_length' => 255, 'required' => false)), 'created_by' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('CreatedBy'), 'required' => false)), 'updated_by' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('UpdatedBy'), 'required' => false)), 'tags_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmTag', 'required' => false))));
$this->widgetSchema->setNameFormat('dm_test_fruit[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}
示例12: setup
public function setup()
{
$this->setWidgets(array('id' => new sfWidgetFormInputHidden(), 'post_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Post'), 'add_empty' => false)), 'author' => new sfWidgetFormInputText(), 'body' => new sfWidgetFormTextarea(), 'is_active' => new sfWidgetFormInputCheckbox(), 'created_at' => new sfWidgetFormDateTime(), 'updated_at' => new sfWidgetFormDateTime(), 'version' => new sfWidgetFormInputText()));
$this->setValidators(array('id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)), 'post_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Post'))), 'author' => new sfValidatorString(array('max_length' => 255, 'required' => false)), 'body' => new sfValidatorString(array('required' => false)), 'is_active' => new sfValidatorBoolean(array('required' => false)), 'created_at' => new sfValidatorDateTime(), 'updated_at' => new sfValidatorDateTime(), 'version' => new sfValidatorInteger(array('required' => false))));
$this->widgetSchema->setNameFormat('dm_test_comment[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}
示例13: setup
public function setup()
{
$this->setWidgets(array('id' => new sfWidgetFormInputHidden(), 'dm_catalogue_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('DmCatalogue'), 'add_empty' => false)), 'source' => new sfWidgetFormTextarea(), 'target' => new sfWidgetFormTextarea(), 'meta' => new sfWidgetFormInputText(), 'created_at' => new sfWidgetFormDateTime(), 'updated_at' => new sfWidgetFormDateTime()));
$this->setValidators(array('id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)), 'dm_catalogue_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('DmCatalogue'))), 'source' => new sfValidatorString(array('max_length' => 60000)), 'target' => new sfValidatorString(array('max_length' => 60000)), 'meta' => new sfValidatorString(array('max_length' => 255, 'required' => false)), 'created_at' => new sfValidatorDateTime(), 'updated_at' => new sfValidatorDateTime()));
$this->widgetSchema->setNameFormat('dm_trans_unit[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}
示例14: setup
public function setup()
{
$this->setWidgets(array('id' => new sfWidgetFormInputHidden(), 'dm_layout_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Layout'), 'add_empty' => true)), 'dm_page_view_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('PageView'), 'add_empty' => true)), 'type' => new sfWidgetFormChoice(array('choices' => array('content' => 'content', 'top' => 'top', 'bottom' => 'bottom', 'left' => 'left', 'right' => 'right')))));
$this->setValidators(array('id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)), 'dm_layout_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Layout'), 'required' => false)), 'dm_page_view_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('PageView'), 'required' => false)), 'type' => new sfValidatorChoice(array('choices' => array(0 => 'content', 1 => 'top', 2 => 'bottom', 3 => 'left', 4 => 'right'), 'required' => false))));
$this->widgetSchema->setNameFormat('dm_area[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}
示例15: setup
public function setup()
{
$this->setWidgets(array('id' => new sfWidgetFormInputHidden(), 'username' => new sfWidgetFormInputText(), 'email' => new sfWidgetFormInputText(), 'algorithm' => new sfWidgetFormInputText(), 'salt' => new sfWidgetFormInputText(), 'password' => new sfWidgetFormInputText(), 'is_active' => new sfWidgetFormInputCheckbox(), 'is_super_admin' => new sfWidgetFormInputCheckbox(), 'last_login' => new sfWidgetFormDateTime(), 'forgot_password_code' => new sfWidgetFormInputText(), 'created_at' => new sfWidgetFormDateTime(), 'updated_at' => new sfWidgetFormDateTime(), 'groups_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'DmGroup', 'expanded' => true)), 'permissions_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'DmPermission', 'expanded' => true))));
$this->setValidators(array('id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)), 'username' => new sfValidatorString(array('max_length' => 255)), 'email' => new sfValidatorString(array('max_length' => 255)), 'algorithm' => new sfValidatorString(array('max_length' => 128, 'required' => false)), 'salt' => new sfValidatorString(array('max_length' => 128, 'required' => false)), 'password' => new sfValidatorString(array('max_length' => 128, 'required' => false)), 'is_active' => new sfValidatorBoolean(array('required' => false)), 'is_super_admin' => new sfValidatorBoolean(array('required' => false)), 'last_login' => new sfValidatorDateTime(array('required' => false)), 'forgot_password_code' => new sfValidatorString(array('max_length' => 12, 'required' => false)), 'created_at' => new sfValidatorDateTime(), 'updated_at' => new sfValidatorDateTime(), 'groups_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmGroup', 'required' => false)), 'permissions_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'DmPermission', 'required' => false))));
$this->validatorSchema->setPostValidator(new sfValidatorAnd(array(new sfValidatorDoctrineUnique(array('model' => 'DmUser', 'column' => array('username'))), new sfValidatorDoctrineUnique(array('model' => 'DmUser', 'column' => array('email'))), new sfValidatorDoctrineUnique(array('model' => 'DmUser', 'column' => array('forgot_password_code'))))));
$this->widgetSchema->setNameFormat('dm_user[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
// Unset automatic fields like 'created_at', 'updated_at', 'position'
// override this method in your form to keep them
parent::unsetAutoFields();
}