本文整理汇总了PHP中BaseFormDoctrine类的典型用法代码示例。如果您正苦于以下问题:PHP BaseFormDoctrine类的具体用法?PHP BaseFormDoctrine怎么用?PHP BaseFormDoctrine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BaseFormDoctrine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: embedCollection
/**
* A convenience method for embedding collections.
*
* @param BaseFormDoctrine $form
* @param string $formName
* @param string $relationAlias
* @param array $options
* @return void
*/
private static function embedCollection(BaseFormDoctrine $form, $formName, $relationAlias, array $options)
{
// set required options
$options['parent_object'] = $form->getObject();
$options['relation_alias'] = $relationAlias;
// initialize and embed the collection form
$collectionForm = new jmsBaseCollectionForm(array(), $options);
$form->embedForm($formName, $collectionForm);
}
示例2: setup
public function setup()
{
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'country_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Country'), 'add_empty' => false)),
'code' => new sfWidgetFormInputText(),
'name' => new sfWidgetFormInputText(),
'created_at' => new sfWidgetFormDateTime(),
'updated_at' => new sfWidgetFormDateTime(),
));
$this->setValidators(array(
'id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
'country_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Country'))),
'code' => new sfValidatorString(array('max_length' => 32, 'required' => false)),
'name' => new sfValidatorString(array('max_length' => 64)),
'created_at' => new sfValidatorDateTime(),
'updated_at' => new sfValidatorDateTime(),
));
$this->widgetSchema->setNameFormat('showmobile_zone[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}
示例3: doSave
protected function doSave($con = null)
{
$this->saveGroupsList($con);
$this->savePermissionsList($con);
$this->saveTypesList($con);
parent::doSave($con);
}
示例4: setup
public function setup()
{
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'mailinglistversion_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('MailinglistVersion'), 'add_empty' => true)),
'type' => new sfWidgetFormInputText(),
'deleteworkflow' => new sfWidgetFormInputText(),
'archiveworkflow' => new sfWidgetFormInputText(),
'stopneworkflow' => new sfWidgetFormInputText(),
'detailsworkflow' => new sfWidgetFormInputText(),
));
$this->setValidators(array(
'id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
'mailinglistversion_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('MailinglistVersion'), 'required' => false)),
'type' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
'deleteworkflow' => new sfValidatorInteger(array('required' => false)),
'archiveworkflow' => new sfValidatorInteger(array('required' => false)),
'stopneworkflow' => new sfValidatorInteger(array('required' => false)),
'detailsworkflow' => new sfValidatorInteger(array('required' => false)),
));
$this->widgetSchema->setNameFormat('mailinglist_authorization_setting[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}
示例5: setup
public function setup()
{
$this->setWidgets(array(
'non_psycho_pat_id' => new sfWidgetFormInputHidden(),
'ad_patient_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('AdPatient'), 'add_empty' => false)),
'non_psycho_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('AdNonPsycho'), 'add_empty' => false)),
'start_date' => new sfWidgetFormDateTime(),
'stop_date' => new sfWidgetFormDateTime(),
));
$this->setValidators(array(
'non_psycho_pat_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('non_psycho_pat_id')), 'empty_value' => $this->getObject()->get('non_psycho_pat_id'), 'required' => false)),
'ad_patient_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('AdPatient'))),
'non_psycho_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('AdNonPsycho'))),
'start_date' => new sfValidatorDateTime(),
'stop_date' => new sfValidatorDateTime(array('required' => false)),
));
$this->widgetSchema->setNameFormat('ad_non_psycho_pat[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}
示例6: doSave
protected function doSave($con = null)
{
$this->saveAlbumsList($con);
$this->savePhotosList($con);
$this->saveEventList($con);
parent::doSave($con);
}
示例7: setup
public function setup()
{
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'reason' => new sfWidgetFormTextarea(),
'referer' => new sfWidgetFormInputText(),
'state' => new sfWidgetFormChoice(array('choices' => array('valid' => 'valid', 'invalid' => 'invalid', 'untreated' => 'untreated'))),
'id_comment' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Comment'), 'add_empty' => false)),
'created_at' => new sfWidgetFormDateTime(),
'updated_at' => new sfWidgetFormDateTime(),
));
$this->setValidators(array(
'id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
'reason' => new sfValidatorString(),
'referer' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
'state' => new sfValidatorChoice(array('choices' => array(0 => 'valid', 1 => 'invalid', 2 => 'untreated'), 'required' => false)),
'id_comment' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Comment'))),
'created_at' => new sfValidatorDateTime(),
'updated_at' => new sfValidatorDateTime(),
));
$this->widgetSchema->setNameFormat('comment_report[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}
示例8: setup
public function setup()
{
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'class_letter_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ClassLetter'), 'add_empty' => false)),
'person_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Person'), 'add_empty' => false)),
'enrolment_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Enrolment'), 'add_empty' => true)),
'sent_at' => new sfWidgetFormDateTime(),
'success' => new sfWidgetFormInputCheckbox(),
'failed' => new sfWidgetFormInputCheckbox(),
'email' => new sfWidgetFormInputText(),
'body' => new sfWidgetFormTextarea(),
));
$this->setValidators(array(
'id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
'class_letter_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ClassLetter'))),
'person_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Person'))),
'enrolment_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Enrolment'), 'required' => false)),
'sent_at' => new sfValidatorDateTime(),
'success' => new sfValidatorBoolean(array('required' => false)),
'failed' => new sfValidatorBoolean(array('required' => false)),
'email' => new sfValidatorEmail(array('max_length' => 255, 'required' => false)),
'body' => new sfValidatorString(array('required' => false)),
));
$this->widgetSchema->setNameFormat('ds_class_letter_recipient[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}
示例9: doSave
protected function doSave($con = null)
{
$this->savegroupsList($con);
$this->savepermissionsList($con);
$this->saveSkinnyChecksList($con);
parent::doSave($con);
}
示例10: setup
public function setup()
{
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'address_format' => new sfWidgetFormInputText(),
'address_summary' => new sfWidgetFormInputText(),
'created_at' => new sfWidgetFormDateTime(),
'updated_at' => new sfWidgetFormDateTime(),
));
$this->setValidators(array(
'id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
'address_format' => new sfValidatorString(array('max_length' => 128)),
'address_summary' => new sfValidatorString(array('max_length' => 48, 'required' => false)),
'created_at' => new sfValidatorDateTime(),
'updated_at' => new sfValidatorDateTime(),
));
$this->widgetSchema->setNameFormat('showmobile_address_format[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}
示例11: setup
public function setup()
{
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'name' => new sfWidgetFormInputText(),
'city' => new sfWidgetFormInputText(),
'state' => new sfWidgetFormInputText(),
'zip' => new sfWidgetFormInputText(),
'created_at' => new sfWidgetFormDateTime(),
'updated_at' => new sfWidgetFormDateTime(),
));
$this->setValidators(array(
'id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
'name' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
'city' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
'state' => new sfValidatorString(array('max_length' => 25, 'required' => false)),
'zip' => new sfValidatorString(array('max_length' => 25, 'required' => false)),
'created_at' => new sfValidatorDateTime(),
'updated_at' => new sfValidatorDateTime(),
));
$this->widgetSchema->setNameFormat('company[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}
示例12: doSave
protected function doSave($con = null)
{
$this->saveConnectedProductsList($con);
$this->saveParameterOptionsList($con);
$this->saveProductOrderList($con);
parent::doSave($con);
}
示例13: setup
public function setup()
{
$this->setWidgets(array(
'id' => new sfWidgetFormInputHidden(),
'title' => new sfWidgetFormInputText(),
'type' => new sfWidgetFormInputText(),
'writeprotected' => new sfWidgetFormInputText(),
'color' => new sfWidgetFormInputText(),
'deleted_at' => new sfWidgetFormDateTime(),
));
$this->setValidators(array(
'id' => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
'title' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
'type' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
'writeprotected' => new sfValidatorInteger(array('required' => false)),
'color' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
'deleted_at' => new sfValidatorDateTime(array('required' => false)),
));
$this->widgetSchema->setNameFormat('field[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}
示例14: doSave
protected function doSave($con = null)
{
$this->savegroupsList($con);
$this->savepermissionsList($con);
$this->saveproceduresList($con);
parent::doSave($con);
}
示例15: setup
public function setup()
{
$this->setWidgets(array(
'notification_id' => new sfWidgetFormInputHidden(),
'prev_user_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('AdUser_3'), 'add_empty' => false)),
'new_user_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('AdUser'), 'add_empty' => false)),
'patient_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('AdPatient'), 'add_empty' => false)),
'reason' => new sfWidgetFormTextarea(),
'accepted' => new sfWidgetFormInputText(),
'checked' => new sfWidgetFormInputText(),
'date' => new sfWidgetFormDateTime(),
));
$this->setValidators(array(
'notification_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('notification_id')), 'empty_value' => $this->getObject()->get('notification_id'), 'required' => false)),
'prev_user_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('AdUser_3'))),
'new_user_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('AdUser'))),
'patient_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('AdPatient'))),
'reason' => new sfValidatorString(array('required' => false)),
'accepted' => new sfValidatorInteger(array('required' => false)),
'checked' => new sfValidatorInteger(array('required' => false)),
'date' => new sfValidatorDateTime(),
));
$this->widgetSchema->setNameFormat('ad_notification[%s]');
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
$this->setupInheritance();
parent::setup();
}