Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql Symfony 1.4,原则1.2:编辑对象后,是否删除其他相关对象?_Mysql_Symfony1_Doctrine_Symfony 1.4_Doctrine 1.2 - Fatal编程技术网

Mysql Symfony 1.4,原则1.2:编辑对象后,是否删除其他相关对象?

Mysql Symfony 1.4,原则1.2:编辑对象后,是否删除其他相关对象?,mysql,symfony1,doctrine,symfony-1.4,doctrine-1.2,Mysql,Symfony1,Doctrine,Symfony 1.4,Doctrine 1.2,在我的应用程序中,显示器有许多基准测试(1对多) 在监视器编辑界面中,当我保存修改时,每个具有监视器id的基准都会被删除,我编辑的基准也会被删除 Monitor: tableName: monitor actAs: Timestampable: ~ columns: id : {type: integer(4), primary: true, autoincrement: true} label: {type: string(45)} url: {ty

在我的应用程序中,显示器有许多基准测试(1对多) 在监视器编辑界面中,当我保存修改时,每个具有监视器id的基准都会被删除,我编辑的基准也会被删除

Monitor:
  tableName: monitor
  actAs:
    Timestampable: ~
  columns:
    id : {type: integer(4), primary: true, autoincrement: true}
    label: {type: string(45)}
    url: {type: string(80)}
    frequency: {type: integer}
    timeout: {type: integer}
    method: {type: enum, values: [GET, POST, HEAD, PUT, DELETE]}
    parameters: {type: string(255)}
    active : { type: boolean, notnull: true, default: 1 }
  relations:
    GroupsByAlert:
      class: sfGuardGroup
      local: monitor_id
      foreign: sf_guard_group_id
      refClass: Alert
      foreignAlias: Groups
    Accidents:
      class: Accident
      local: id
      foreign: monitor_id

Benchmark:
  #detect_relations: true
  tableName: benchmark
  actAs:
    Timestampable: ~
  columns:
    #id: {type: integer(4), primary: true,autoincrement: true}
    monitor_id: { type: integer(4)}
    server_id: { type: integer(4)}
    connexionTime: {type: string(45)}
    executionTime: {type: string(45)}
    responseTime: {type: string(45)}
    responseCode: {type: string(45)}
    responseMessage: {type: string(45)}
    responseBody: {type: blob}
  relations:
    Monitor:
      class: Monitor
      local: monitor_id
      foreign: id
    Server:
      class: Server
      local: server_id
      foreign: id
知道吗?

我找到了答案,伙计们,
实际上,这是我在generator.yml中输入的一个字段,但忘了取消设置,hense Doctrine不知道该做什么,取而代之的是删除所有相关对象并重新创建另一个

当然,这不应该发生。你能把你的代码显示在你检索、编辑和保存你的
基准测试的地方吗?
?当我编辑一个监视器的时候!monnitor是使用管理生成器生成的模块,因此编辑将自动执行!我来这里是为了进一步的信息!实际上,监视器编辑与基准无关!,基准测试只在任务中使用监视器的url(与监视器编辑无关),编辑监视器应该做的只是修改,而不做其他事情。但是它仍然删除了那些有“monito_id”=这个监视器的基准测试。请问,有人知道会出现什么问题吗????