bonjour,
j'etulise un formulaire qui imbrique 2 module Kk et Client tous se passe bien pour l'affichage et sauvgarde mais pour la modification j'ai mis une fonction qui me retourne tous les donné des 2 table mais il y'a un probléme The "ClientForm" form only accepts a "Client" object.
voici ma fonction :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
 function modifier(){
        $liste_news = Doctrine_Query::create()
		->from('Client')
		->leftJoin('Client.Kk')
                ->where('hh=2')
                ->andWhere('Client.id = ?', 2);
 
       return $liste_news->execute();
    }
et voici l'apple depuis actions.class.php:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
 public function executeEdit(sfWebRequest $request)
  {
      $c=Doctrine::getTable('Client')->modifier();
      $this->form = new ClientForm($c);
  }
et mon schéma :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Client:
  connection: doctrine
  tableName: client
  columns:
    id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true
    nom:
      type: string()
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    prenom:
      type: string()
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
   relations:
   Kk:
      local: id
      foreign: id
      type: many
    Kk:
  connection: doctrine
  tableName: kk
  columns:
    id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    nom:
      type: string()
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    date:
      type: date(25)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    hh:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true
  relations:
    Client:
      local: id
      foreign: id
      type: one
merci