Précédent   Forum des professionnels en informatique > PHP > Bibliothèques et frameworks > symfony
symfony Forum d'entraide sur le framework PHP symfony. Avant de poster : cours symfony et FAQ symfony
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 05/05/2011, 15h44   #1
Membre habitué
 
Homme Ludovic
Étudiant
Inscription : janvier 2011
Messages : 124
Détails du profil
Informations personnelles :
Nom : Homme Ludovic
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : janvier 2011
Messages : 124
Points : 140
Points : 140
Par défaut Question sur le schéma.yml

Bonjour,

Je vous présente mon problème :
Je génère mon schéma à partir d'une BDD et je le corrige à la main. Mais voilà, il y a une chose qui ne fonctionne pas.
Quand j'ai plusieurs liens vers une même table, Doctrine ne récupère que le dernier objet. Par exemple :

sfGuardUserProfile -> Node
node_id -> id
sfGuardUserProfile -> Node
node_leading_id -> id

Code :
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
sfGuardUserProfile:
  actAs:
    Timestampable: ~
  columns:
#...
    node_id:
      type: integer
#...
    node_leading_id:
      type: integer
#...
  relations:
#...
    Node:
      class: Node
      local: node_id
      foreign: id
      foreignAlias: Persons
    NodeLeading:
      class: Node
      local: node_leading_id
      foreign: id
      foreignAlias: Leaders
      onDelete: SET NULL
#...
Node:
  connection: doctrine
  tableName: node
  columns:
    id:
      type: integer
      primary: true
      autoincrement: true
    num:
      type: integer
      unsigned: true
      notnull: true
    name:
      type: string(60)
      notnull: true
    url:
      type: string(150)
      default: 'http://'
  relations:
    Pdsnodes:
      class: Pdsnode
      local: node_id
      foreign: pdsnode_id
      foreignAlias: Nodes
      refClass: NodePdsnode
    Sciencecases:
      class: Sciencecase
      local: node_id
      foreign: sciencecase_id
      foreignAlias: Nodes
      refClass: NodeSciencecase
    Resources:
      class: Resource
      local: node_id
      foreign: resource_id
      refClass: ResourceNode
      foreignAlias: Nodes
Quand je génère les classes, j'ai bien les deux propriétés et les deux getter/setter en commentaire de la classe BasesfGuardUserProfile mais lors de l'affichage dans un module admin generator, la colonne Node ne s'affiche pas alors que la colonne NodeLeading s'affiche correctement.
Donc j'ai décidé de faire un getter dans la classe sfGuardUserProfile :
Code :
1
2
3
4
    public function getNode()
    {
        return $this->Node->name;
    }
Mais il m'affiche dans la colonne :
Code :
Notice: Undefined property: sfGuardUserProfile::$Node in /home/lvielle/workspace/test/lib/model/doctrine/sfForkedDoctrineApplyPlugin/sfGuardUserProfile.class.php on line 27 Call Stack: 0.0001 322212 1. {main}() /home/lvielle/workspace/test/web/main_dev.php:0 0.0768 2759632 2. sfContext->dispatch() /home/lvielle/workspace/test/web/main_dev.php:13 0.0768 2759660 3. sfFrontWebController->dispatch() /home/lvielle/workspace/symfony14/lib/util/sfContext.class.php:170 0.0769 2766244 4. sfController->forward() /home/lvielle/workspace/symfony14/lib/controller/sfFrontWebController.class.php:48 0.0811 2922484 5. sfFilterChain->execute() /home/lvielle/workspace/symfony14/lib/controller/sfController.class.php:238 0.0814 2923292 6. sfRenderingFilter->execute() /home/lvielle/workspace/symfony14/lib/filter/sfFilterChain.class.php:53 0.0814 2923292 7. sfFilterChain->execute() /home/lvielle/workspace/symfony14/lib/filter/sfRenderingFilter.class.php:33 0.0816 2924072 8. sfExecutionFilter->execute() /home/lvielle/workspace/symfony14/lib/filter/sfFilterChain.class.php:53 0.1526 5590692 9. sfExecutionFilter->handleView() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:47 0.1526 5590692 10. sfExecutionFilter->executeView() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:116 0.1542 5621252 11. sfPHPView->render() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:155 0.1543 5621504 12. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:185 0.1571 5788700 13. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/indexSuccess.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.3712 6718084 14. include_partial() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/indexSuccess.php:19 0.3712 6718084 15. get_partial() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:180 0.3717 6721396 16. sfPartialView->render() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:218 0.3718 6722364 17. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPartialView.class.php:124 0.3731 6770276 18. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.4843 6996448 19. include_partial() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list.php:31 0.4843 6996448 20. get_partial() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:180 0.4848 6999400 21. sfPartialView->render() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:218 0.4849 7000392 22. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPartialView.class.php:124 0.4859 7049264 23. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list_td_tabular.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.4917 7055852 24. sfOutputEscaperIteratorDecorator->getNode() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list_td_tabular.php:20 0.4917 7055996 25. sfOutputEscaperObjectDecorator->__call() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:0 0.4917 7056228 26. call_user_func_array() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:64 0.4917 7056360 27. sfGuardUserProfile->getNode() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:0 0.4917 7056468 28. Doctrine_Access->__get() /home/lvielle/workspace/symfony14/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Access.php:0 0.4917 7056468 29. Doctrine_Record->get() /home/lvielle/workspace/symfony14/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Access.php:72 0.4918 7056864 30. sfGuardUserProfile->getNode() /home/lvielle/workspace/symfony14/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php:1347 Notice: Trying to get property of non-object in /home/lvielle/workspace/test/lib/model/doctrine/sfForkedDoctrineApplyPlugin/sfGuardUserProfile.class.php on line 27 Call Stack: 0.0001 322212 1. {main}() /home/lvielle/workspace/test/web/main_dev.php:0 0.0768 2759632 2. sfContext->dispatch() /home/lvielle/workspace/test/web/main_dev.php:13 0.0768 2759660 3. sfFrontWebController->dispatch() /home/lvielle/workspace/symfony14/lib/util/sfContext.class.php:170 0.0769 2766244 4. sfController->forward() /home/lvielle/workspace/symfony14/lib/controller/sfFrontWebController.class.php:48 0.0811 2922484 5. sfFilterChain->execute() /home/lvielle/workspace/symfony14/lib/controller/sfController.class.php:238 0.0814 2923292 6. sfRenderingFilter->execute() /home/lvielle/workspace/symfony14/lib/filter/sfFilterChain.class.php:53 0.0814 2923292 7. sfFilterChain->execute() /home/lvielle/workspace/symfony14/lib/filter/sfRenderingFilter.class.php:33 0.0816 2924072 8. sfExecutionFilter->execute() /home/lvielle/workspace/symfony14/lib/filter/sfFilterChain.class.php:53 0.1526 5590692 9. sfExecutionFilter->handleView() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:47 0.1526 5590692 10. sfExecutionFilter->executeView() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:116 0.1542 5621252 11. sfPHPView->render() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:155 0.1543 5621504 12. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:185 0.1571 5788700 13. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/indexSuccess.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.3712 6718084 14. include_partial() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/indexSuccess.php:19 0.3712 6718084 15. get_partial() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:180 0.3717 6721396 16. sfPartialView->render() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:218 0.3718 6722364 17. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPartialView.class.php:124 0.3731 6770276 18. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.4843 6996448 19. include_partial() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list.php:31 0.4843 6996448 20. get_partial() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:180 0.4848 6999400 21. sfPartialView->render() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:218 0.4849 7000392 22. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPartialView.class.php:124 0.4859 7049264 23. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list_td_tabular.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.4917 7055852 24. sfOutputEscaperIteratorDecorator->getNode() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list_td_tabular.php:20 0.4917 7055996 25. sfOutputEscaperObjectDecorator->__call() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:0 0.4917 7056228 26. call_user_func_array() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:64 0.4917 7056360 27. sfGuardUserProfile->getNode() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:0 0.4917 7056468 28. Doctrine_Access->__get() /home/lvielle/workspace/symfony14/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Access.php:0 0.4917 7056468 29. Doctrine_Record->get() /home/lvielle/workspace/symfony14/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Access.php:72 0.4918 7056864 30. sfGuardUserProfile->getNode() /home/lvielle/workspace/symfony14/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php:1347 Notice: Trying to get property of non-object in /home/lvielle/workspace/test/lib/model/doctrine/sfForkedDoctrineApplyPlugin/sfGuardUserProfile.class.php on line 27 Call Stack: 0.0001 322212 1. {main}() /home/lvielle/workspace/test/web/main_dev.php:0 0.0768 2759632 2. sfContext->dispatch() /home/lvielle/workspace/test/web/main_dev.php:13 0.0768 2759660 3. sfFrontWebController->dispatch() /home/lvielle/workspace/symfony14/lib/util/sfContext.class.php:170 0.0769 2766244 4. sfController->forward() /home/lvielle/workspace/symfony14/lib/controller/sfFrontWebController.class.php:48 0.0811 2922484 5. sfFilterChain->execute() /home/lvielle/workspace/symfony14/lib/controller/sfController.class.php:238 0.0814 2923292 6. sfRenderingFilter->execute() /home/lvielle/workspace/symfony14/lib/filter/sfFilterChain.class.php:53 0.0814 2923292 7. sfFilterChain->execute() /home/lvielle/workspace/symfony14/lib/filter/sfRenderingFilter.class.php:33 0.0816 2924072 8. sfExecutionFilter->execute() /home/lvielle/workspace/symfony14/lib/filter/sfFilterChain.class.php:53 0.1526 5590692 9. sfExecutionFilter->handleView() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:47 0.1526 5590692 10. sfExecutionFilter->executeView() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:116 0.1542 5621252 11. sfPHPView->render() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:155 0.1543 5621504 12. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:185 0.1571 5788700 13. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/indexSuccess.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.3712 6718084 14. include_partial() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/indexSuccess.php:19 0.3712 6718084 15. get_partial() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:180 0.3717 6721396 16. sfPartialView->render() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:218 0.3718 6722364 17. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPartialView.class.php:124 0.3731 6770276 18. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.4843 6996448 19. include_partial() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list.php:31 0.4843 6996448 20. get_partial() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:180 0.4848 6999400 21. sfPartialView->render() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:218 0.4849 7000392 22. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPartialView.class.php:124 0.4859 7049264 23. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list_td_tabular.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.4917 7055852 24. sfOutputEscaperIteratorDecorator->getNode() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list_td_tabular.php:20 0.4917 7055996 25. sfOutputEscaperObjectDecorator->__call() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:0 0.4917 7056228 26. call_user_func_array() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:64 0.4917 7056360 27. sfGuardUserProfile->getNode() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:0 	Notice: Undefined property: sfGuardUserProfile::$Node in /home/lvielle/workspace/test/lib/model/doctrine/sfForkedDoctrineApplyPlugin/sfGuardUserProfile.class.php on line 27 Call Stack: 0.0001 322212 1. {main}() /home/lvielle/workspace/test/web/main_dev.php:0 0.0768 2759632 2. sfContext->dispatch() /home/lvielle/workspace/test/web/main_dev.php:13 0.0768 2759660 3. sfFrontWebController->dispatch() /home/lvielle/workspace/symfony14/lib/util/sfContext.class.php:170 0.0769 2766244 4. sfController->forward() /home/lvielle/workspace/symfony14/lib/controller/sfFrontWebController.class.php:48 0.0811 2922484 5. sfFilterChain->execute() /home/lvielle/workspace/symfony14/lib/controller/sfController.class.php:238 0.0814 2923292 6. sfRenderingFilter->execute() /home/lvielle/workspace/symfony14/lib/filter/sfFilterChain.class.php:53 0.0814 2923292 7. sfFilterChain->execute() /home/lvielle/workspace/symfony14/lib/filter/sfRenderingFilter.class.php:33 0.0816 2924072 8. sfExecutionFilter->execute() /home/lvielle/workspace/symfony14/lib/filter/sfFilterChain.class.php:53 0.1526 5590692 9. sfExecutionFilter->handleView() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:47 0.1526 5590692 10. sfExecutionFilter->executeView() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:116 0.1542 5621252 11. sfPHPView->render() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:155 0.1543 5621504 12. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:185 0.1571 5788700 13. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/indexSuccess.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.3712 6718084 14. include_partial() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/indexSuccess.php:19 0.3712 6718084 15. get_partial() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:180 0.3717 6721396 16. sfPartialView->render() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:218 0.3718 6722364 17. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPartialView.class.php:124 0.3731 6770276 18. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.4843 6996448 19. include_partial() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list.php:31 0.4843 6996448 20. get_partial() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:180 0.4848 6999400 21. sfPartialView->render() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:218 0.4849 7000392 22. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPartialView.class.php:124 0.4859 7049264 23. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list_td_tabular.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.4917 7055852 24. sfOutputEscaperIteratorDecorator->getNode() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list_td_tabular.php:20 0.4917 7055996 25. sfOutputEscaperObjectDecorator->__call() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:0 0.4917 7056228 26. call_user_func_array() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:64 0.4917 7056360 27. sfGuardUserProfile->getNode() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:0 0.4917 7056468 28. Doctrine_Access->__get() /home/lvielle/workspace/symfony14/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Access.php:0 0.4917 7056468 29. Doctrine_Record->get() /home/lvielle/workspace/symfony14/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Access.php:72 0.4918 7056864 30. sfGuardUserProfile->getNode() /home/lvielle/workspace/symfony14/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php:1347 Notice: Trying to get property of non-object in /home/lvielle/workspace/test/lib/model/doctrine/sfForkedDoctrineApplyPlugin/sfGuardUserProfile.class.php on line 27 Call Stack: 0.0001 322212 1. {main}() /home/lvielle/workspace/test/web/main_dev.php:0 0.0768 2759632 2. sfContext->dispatch() /home/lvielle/workspace/test/web/main_dev.php:13 0.0768 2759660 3. sfFrontWebController->dispatch() /home/lvielle/workspace/symfony14/lib/util/sfContext.class.php:170 0.0769 2766244 4. sfController->forward() /home/lvielle/workspace/symfony14/lib/controller/sfFrontWebController.class.php:48 0.0811 2922484 5. sfFilterChain->execute() /home/lvielle/workspace/symfony14/lib/controller/sfController.class.php:238 0.0814 2923292 6. sfRenderingFilter->execute() /home/lvielle/workspace/symfony14/lib/filter/sfFilterChain.class.php:53 0.0814 2923292 7. sfFilterChain->execute() /home/lvielle/workspace/symfony14/lib/filter/sfRenderingFilter.class.php:33 0.0816 2924072 8. sfExecutionFilter->execute() /home/lvielle/workspace/symfony14/lib/filter/sfFilterChain.class.php:53 0.1526 5590692 9. sfExecutionFilter->handleView() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:47 0.1526 5590692 10. sfExecutionFilter->executeView() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:116 0.1542 5621252 11. sfPHPView->render() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:155 0.1543 5621504 12. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:185 0.1571 5788700 13. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/indexSuccess.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.3712 6718084 14. include_partial() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/indexSuccess.php:19 0.3712 6718084 15. get_partial() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:180 0.3717 6721396 16. sfPartialView->render() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:218 0.3718 6722364 17. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPartialView.class.php:124 0.3731 6770276 18. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.4843 6996448 19. include_partial() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list.php:31 0.4843 6996448 20. get_partial() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:180 0.4848 6999400 21. sfPartialView->render() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:218 0.4849 7000392 22. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPartialView.class.php:124 0.4859 7049264 23. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list_td_tabular.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.4917 7055852 24. sfOutputEscaperIteratorDecorator->getNode() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list_td_tabular.php:20 0.4917 7055996 25. sfOutputEscaperObjectDecorator->__call() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:0 0.4917 7056228 26. call_user_func_array() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:64 0.4917 7056360 27. sfGuardUserProfile->getNode() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:0 0.4917 7056468 28. Doctrine_Access->__get() /home/lvielle/workspace/symfony14/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Access.php:0 0.4917 7056468 29. Doctrine_Record->get() /home/lvielle/workspace/symfony14/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Access.php:72 0.4918 7056864 30. sfGuardUserProfile->getNode() /home/lvielle/workspace/symfony14/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record.php:1347 Notice: Trying to get property of non-object in /home/lvielle/workspace/test/lib/model/doctrine/sfForkedDoctrineApplyPlugin/sfGuardUserProfile.class.php on line 27 Call Stack: 0.0001 322212 1. {main}() /home/lvielle/workspace/test/web/main_dev.php:0 0.0768 2759632 2. sfContext->dispatch() /home/lvielle/workspace/test/web/main_dev.php:13 0.0768 2759660 3. sfFrontWebController->dispatch() /home/lvielle/workspace/symfony14/lib/util/sfContext.class.php:170 0.0769 2766244 4. sfController->forward() /home/lvielle/workspace/symfony14/lib/controller/sfFrontWebController.class.php:48 0.0811 2922484 5. sfFilterChain->execute() /home/lvielle/workspace/symfony14/lib/controller/sfController.class.php:238 0.0814 2923292 6. sfRenderingFilter->execute() /home/lvielle/workspace/symfony14/lib/filter/sfFilterChain.class.php:53 0.0814 2923292 7. sfFilterChain->execute() /home/lvielle/workspace/symfony14/lib/filter/sfRenderingFilter.class.php:33 0.0816 2924072 8. sfExecutionFilter->execute() /home/lvielle/workspace/symfony14/lib/filter/sfFilterChain.class.php:53 0.1526 5590692 9. sfExecutionFilter->handleView() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:47 0.1526 5590692 10. sfExecutionFilter->executeView() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:116 0.1542 5621252 11. sfPHPView->render() /home/lvielle/workspace/symfony14/lib/filter/sfExecutionFilter.class.php:155 0.1543 5621504 12. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:185 0.1571 5788700 13. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/indexSuccess.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.3712 6718084 14. include_partial() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/indexSuccess.php:19 0.3712 6718084 15. get_partial() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:180 0.3717 6721396 16. sfPartialView->render() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:218 0.3718 6722364 17. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPartialView.class.php:124 0.3731 6770276 18. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.4843 6996448 19. include_partial() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list.php:31 0.4843 6996448 20. get_partial() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:180 0.4848 6999400 21. sfPartialView->render() /home/lvielle/workspace/symfony14/lib/helper/PartialHelper.php:218 0.4849 7000392 22. sfPHPView->renderFile() /home/lvielle/workspace/symfony14/lib/view/sfPartialView.class.php:124 0.4859 7049264 23. require('/home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list_td_tabular.php') /home/lvielle/workspace/symfony14/lib/view/sfPHPView.class.php:75 0.4917 7055852 24. sfOutputEscaperIteratorDecorator->getNode() /home/lvielle/workspace/test/cache/main/dev/modules/autoProfile/templates/_list_td_tabular.php:20 0.4917 7055996 25. sfOutputEscaperObjectDecorator->__call() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:0 0.4917 7056228 26. call_user_func_array() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:64 0.4917 7056360 27. sfGuardUserProfile->getNode() /home/lvielle/workspace/symfony14/lib/escaper/sfOutputEscaperObjectDecorator.class.php:0
J'en est déduit que Doctrine ne récupérait pas l'objet Node. Que faire ?
PeytaWodka est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/05/2011, 15h54   #2
Modérateur
 
Avatar de Michel Rotta
 
Homme Michel Rotta
Responsable d'exploitation informatique
Inscription : septembre 2005
Messages : 4 913
Détails du profil
Informations personnelles :
Nom : Homme Michel Rotta
Âge : 49
Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

Informations professionnelles :
Activité : Responsable d'exploitation informatique
Secteur : Distribution

Informations forums :
Inscription : septembre 2005
Messages : 4 913
Points : 7 505
Points : 7 505
Il faut créer le shema.yml pour avoir une base de données

et pas

créer une base de données pour avoir un shema.yml.


Reprends le shema.yml, faisant quelque chose qui correspond à ce que tu veux, génères ta base à partir de ce fichier et contemples ton application qui fonctionne... enfin presque, juste quelques écrans qui restent à dessiner
__________________
Si tu donnes un poisson à un homme, il mangera un jour. Si tu lui apprends à pêcher, il mangera toujours (Lao Tseu).
  • Pensez à valoriser les réponses pertinantes, cliquez sur le bouton vert +1 pour indiquer votre accord avec la solution proposée.
  • Pensez à utiliser la balise [code] pour afficher du code, elle est cachée sous le bouton [#] dans l'éditeur.
  • Une discussion est terminée ? Alors le bouton est votre ami !
Michel Rotta est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/05/2011, 15h59   #3
Membre habitué
 
Homme Ludovic
Étudiant
Inscription : janvier 2011
Messages : 124
Détails du profil
Informations personnelles :
Nom : Homme Ludovic
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : janvier 2011
Messages : 124
Points : 140
Points : 140
Je l'ai repris de zéro pratiquement, les seules choses que je garde c'est les nom des champs, des classes etc. J'ai repris toutes les relations à la main mais je n'arrive pas à faire fonctionner ce type de relation.
PeytaWodka est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/05/2011, 16h32   #4
Modérateur
 
Avatar de Michel Rotta
 
Homme Michel Rotta
Responsable d'exploitation informatique
Inscription : septembre 2005
Messages : 4 913
Détails du profil
Informations personnelles :
Nom : Homme Michel Rotta
Âge : 49
Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

Informations professionnelles :
Activité : Responsable d'exploitation informatique
Secteur : Distribution

Informations forums :
Inscription : septembre 2005
Messages : 4 913
Points : 7 505
Points : 7 505
Revu à "ma façon"
Code :
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
 
sfGuardUserProfile:
  actAs:
    Timestampable: ~
  columns:
#...
    node_id:
      type: integer
#...
    node_leading_id:
      type: integer
#...
  relations:
#...
    Node:
      foreignAlias: Profiles
    NodeLeading:
      class: Node
      local: node_leading_id
      foreignAlias: Leaders
      onDelete: SET NULL
#...
Node:
  columns:
    num:
      type: integer
      unsigned: true
      notnull: true
    name:
      type: string(60)
      notnull: true
    url:
      type: string(150)
      default: 'http://'
  relations:
    Pdsnodes:
    # Cette relation est incorecte, pas de node_id dans la table node. Impossible de savoir pour Pdsnode. 
    # De plus refClass laisse voir une relation n-n mais est incompatible avec local et foreign
      class: Pdsnode
      local: node_id
      foreign: pdsnode_id
      foreignAlias: Nodes
      refClass: NodePdsnode
    Sciencecases:
    # idem
      class: Sciencecase
      local: node_id
      foreign: sciencecase_id
      foreignAlias: Nodes
      refClass: NodeSciencecase
    Resources:
    # idem
      class: Resource
      local: node_id
      foreign: resource_id
      refClass: ResourceNode
      foreignAlias: Nodes
Voir commentaires
__________________
Si tu donnes un poisson à un homme, il mangera un jour. Si tu lui apprends à pêcher, il mangera toujours (Lao Tseu).
  • Pensez à valoriser les réponses pertinantes, cliquez sur le bouton vert +1 pour indiquer votre accord avec la solution proposée.
  • Pensez à utiliser la balise [code] pour afficher du code, elle est cachée sous le bouton [#] dans l'éditeur.
  • Une discussion est terminée ? Alors le bouton est votre ami !
Michel Rotta est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/05/2011, 16h45   #5
Membre habitué
 
Homme Ludovic
Étudiant
Inscription : janvier 2011
Messages : 124
Détails du profil
Informations personnelles :
Nom : Homme Ludovic
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : janvier 2011
Messages : 124
Points : 140
Points : 140
Pour les relations many-to-many, j'ai fait comme dans la doc (http://www.doctrine-project.org/proj...s:many-to-many) et comme dans jobeet. Celles-ci fonctionnent bien par contre le double lien vers la même table ne fonctionne pas même après correction comme tu as fait. Toujours la même erreur.
PeytaWodka est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/05/2011, 16h58   #6
Modérateur
 
Avatar de Michel Rotta
 
Homme Michel Rotta
Responsable d'exploitation informatique
Inscription : septembre 2005
Messages : 4 913
Détails du profil
Informations personnelles :
Nom : Homme Michel Rotta
Âge : 49
Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

Informations professionnelles :
Activité : Responsable d'exploitation informatique
Secteur : Distribution

Informations forums :
Inscription : septembre 2005
Messages : 4 913
Points : 7 505
Points : 7 505
Le geter est automatiquement généré lors du build.

Si tu en fais un toi même, tu détruis celui généré (qui lui doit fonctionner).

Ton geter fait référence à une propriété node qui ne correspond à rien.

Supprimes ta méthode.


Pour les relations n-n, je n'en ai jamais déclaré de cette manière, les miennes marchent. Si celle-ci marche aussi, tant mieux. Mais il faudrait avoir l'ensemble de la déclaration (les trois tables en cause) pour pouvoir juger.
__________________
Si tu donnes un poisson à un homme, il mangera un jour. Si tu lui apprends à pêcher, il mangera toujours (Lao Tseu).
  • Pensez à valoriser les réponses pertinantes, cliquez sur le bouton vert +1 pour indiquer votre accord avec la solution proposée.
  • Pensez à utiliser la balise [code] pour afficher du code, elle est cachée sous le bouton [#] dans l'éditeur.
  • Une discussion est terminée ? Alors le bouton est votre ami !
Michel Rotta est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/05/2011, 17h07   #7
Membre habitué
 
Homme Ludovic
Étudiant
Inscription : janvier 2011
Messages : 124
Détails du profil
Informations personnelles :
Nom : Homme Ludovic
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : janvier 2011
Messages : 124
Points : 140
Points : 140
Sans mon getter, je n'ai rien qui s'affiche dans ma colonne. Si je met node_id, j'ai les bonnes ids qui sont dans la BDD qui s'affiche.
PeytaWodka est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/05/2011, 17h42   #8
Membre habitué
 
Homme Ludovic
Étudiant
Inscription : janvier 2011
Messages : 124
Détails du profil
Informations personnelles :
Nom : Homme Ludovic
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : janvier 2011
Messages : 124
Points : 140
Points : 140
Je pense avoir trouver mon erreur, node est un mot réservé pour doctrine je pense (notion d'arbre et de hiérarchie). Je vais essayé de changer le nom de la table.

Edit: C'était bien ça le problème. J'ai renommé la classe et la table est ça fonctionne.
PeytaWodka est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/05/2011, 17h55   #9
Modérateur
 
Avatar de Michel Rotta
 
Homme Michel Rotta
Responsable d'exploitation informatique
Inscription : septembre 2005
Messages : 4 913
Détails du profil
Informations personnelles :
Nom : Homme Michel Rotta
Âge : 49
Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

Informations professionnelles :
Activité : Responsable d'exploitation informatique
Secteur : Distribution

Informations forums :
Inscription : septembre 2005
Messages : 4 913
Points : 7 505
Points : 7 505
C'est une piste.

Regardes si tu as le code correspondant dans l'objet de base, en fait tu n'as que la déclaration du nom pour les IDE, cela devrait ressembler à :
Code :
 * @method Doctrine_Collection getNode)
Un bon IDE devrait ainsi te proposer la méthode lors sur un objet instancié.
__________________
Si tu donnes un poisson à un homme, il mangera un jour. Si tu lui apprends à pêcher, il mangera toujours (Lao Tseu).
  • Pensez à valoriser les réponses pertinantes, cliquez sur le bouton vert +1 pour indiquer votre accord avec la solution proposée.
  • Pensez à utiliser la balise [code] pour afficher du code, elle est cachée sous le bouton [#] dans l'éditeur.
  • Une discussion est terminée ? Alors le bouton est votre ami !
Michel Rotta est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/05/2011, 17h59   #10
Membre habitué
 
Homme Ludovic
Étudiant
Inscription : janvier 2011
Messages : 124
Détails du profil
Informations personnelles :
Nom : Homme Ludovic
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : janvier 2011
Messages : 124
Points : 140
Points : 140
Oui, quand j'essayai de créer le getter getNode(), il me le proposait, mais il me proposait aussi une autre méthode getNode() de l'objet Doctrine_Record et c'est ce qui m'a mis la puce à l'oreille pour le conflit de nom.
PeytaWodka est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/05/2011, 18h23   #11
Modérateur
 
Avatar de Michel Rotta
 
Homme Michel Rotta
Responsable d'exploitation informatique
Inscription : septembre 2005
Messages : 4 913
Détails du profil
Informations personnelles :
Nom : Homme Michel Rotta
Âge : 49
Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

Informations professionnelles :
Activité : Responsable d'exploitation informatique
Secteur : Distribution

Informations forums :
Inscription : septembre 2005
Messages : 4 913
Points : 7 505
Points : 7 505
Bonne puce, heu, bonne pioche !

Ca marche avec un autre nom ?
__________________
Si tu donnes un poisson à un homme, il mangera un jour. Si tu lui apprends à pêcher, il mangera toujours (Lao Tseu).
  • Pensez à valoriser les réponses pertinantes, cliquez sur le bouton vert +1 pour indiquer votre accord avec la solution proposée.
  • Pensez à utiliser la balise [code] pour afficher du code, elle est cachée sous le bouton [#] dans l'éditeur.
  • Une discussion est terminée ? Alors le bouton est votre ami !
Michel Rotta est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 06/05/2011, 09h06   #12
Membre habitué
 
Homme Ludovic
Étudiant
Inscription : janvier 2011
Messages : 124
Détails du profil
Informations personnelles :
Nom : Homme Ludovic
Localisation : France

Informations professionnelles :
Activité : Étudiant

Informations forums :
Inscription : janvier 2011
Messages : 124
Points : 140
Points : 140
J'ai changé le nom de la classe et de la table et ça fonctionne bien. Normalement, il me semble que dans la doc il est dit qu'il ne faut pas donner de noms réservés au table mais j'ai essayé et ça ne fonctionnait pas donc j'ai changé celui de la classe aussi.
PeytaWodka est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 08h53.


 
 
 
 
Partenaires

Hébergement Web