Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Monitor:
- actAs:
- Timestampable: ~
- columns:
- label: {type: string(45)}
- url: {type: string(80)}
- frequency: {type: integer}
- timeout: {type: integer}
- method: {type: enum, values: [GET, POST]}
- parameters: {type: string(255)}
- relations:
- Server:
- foreignAlias: Servers
- refClass: Benchmark
- local: monitor_id
- foreign: server_id
- Server:
- actAs:
- Timestampable: ~
- columns:
- name: string(255)
- ip: string(255)
- relations:
- Monitor:
- foreignAlias: Monitors
- refClass: Benchmark
- local: server_id
- foreign: monitor_id
- Benchmark:
- actAs:
- Timestampable: ~
- columns:
- monitor_id: { type: integer, primary: true }
- server_id: { type: integer, primary: true }
- connexionTime: {type: string(45)}
- executionTime: {type: string(45)}
- responseTime: {type: string(45)}
- responseCode: {type: string(45)}
- responseMessage: {type: string(45)}
- relations:
- Monitor:
- local: monitor_id
- foreign: id
- foreignAlias: Monitors
- Server:
- local: server_id
- foreign: id
- foreignAlias: Servers
- 500 | Internal Server Error | Doctrine_Connection_Mysql_Exception
- SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`sfmonitoring`.`benchmark`, CONSTRAINT `benchmark_monitor_id_monitor_id` FOREIGN KEY (`monitor_id`) REFERENCES `monitor` (`id`))
- abstract class BaseBenchmarkForm extends BaseFormDoctrine
- {
- public function setup()
- {
- $this->setWidgets(array(
- 'monitor_id' => new sfWidgetFormInputHidden(),
- 'server_id' => new sfWidgetFormInputHidden(),
- 'connexionTime' => new sfWidgetFormInputText(),
- 'executionTime' => new sfWidgetFormInputText(),
- 'responseTime' => new sfWidgetFormInputText(),
- 'responseCode' => new sfWidgetFormInputText(),
- 'responseMessage' => new sfWidgetFormInputText(),
- 'created_at' => new sfWidgetFormDateTime(),
- 'updated_at' => new sfWidgetFormDateTime(),
- ));
- $this->setValidators(array(
- 'monitor_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('monitor_id')), 'empty_value' => $this->getObject()->get('monitor_id'), 'required' => false)),
- 'server_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('server_id')), 'empty_value' => $this->getObject()->get('server_id'), 'required' => false)),
- 'connexionTime' => new sfValidatorString(array('max_length' => 45, 'required' => false)),
- 'executionTime' => new sfValidatorString(array('max_length' => 45, 'required' => false)),
- Monitor:
- tableName: monitor
- actAs:
- Timestampable: ~
- columns:
- label: {type: string(45)}
- url: {type: string(80)}
- frequency: {type: integer}
- timeout: {type: integer}
- method: {type: enum, values: [GET, POST]}
- parameters: {type: string(255)}
- Benchmark:
- actAs:
- Timestampable: ~
- columns:
- monitor_id: { type: integer, primary: true }
- server_id: { type: integer, primary: true }
- connexionTime: {type: string(45)}
- executionTime: {type: string(45)}
- responseTime: {type: string(45)}
- responseCode: {type: string(45)}
- responseMessage: {type: string(45)}
- relations:
- Monitor: { onDelete: CASCADE, local: monitor_id, foreign: id, foreignAlias: Monitors }
- Server: { onDelete: CASCADE, local: server_id, foreign: id, foreignAlias: Servers }
- Server:
- actAs:
- Timestampable: ~
- columns:
- name: string(255)
- ip: string(255)
- public function configure() {
- parent::configure();
- $this->widgetSchema['monitor_id'] = sfWidgetFormDoctrineChoice(array('model' => 'Monitor'));
- $this->widgetSchema['server_id'] = sfWidgetFormDoctrineChoice(array('model' => 'Server'));
- $this->validatorSchema['monitor_id'] = sfValidatorDoctrineChoice(array('model' => 'Monitor'));
- $this->validatorSchema['server_id'] = sfValidatorDoctrineChoice(array('model' => 'Server'));
- }
Add Comment
Please, Sign In to add comment