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 06/07/2011, 11h33   #1
Futur Membre du Club
 
Homme
Étudiant
Inscription : novembre 2008
Messages : 67
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : novembre 2008
Messages : 67
Points : 16
Points : 16
Par défaut Héritage / Undefined function

Bonjour,

j'ai un léger soucis, j'obtiens :

Code :
Fatal error: Call to undefined function getReferenceacc() in /home/web/apache/sites/appliri-qualif.irisa.fr/htdocs/DB_RI/lib/model/doctrine/base/BaseProgrammeAccord.class.php on line 56
Quand j'utilise une méthode d'accès à une donnée générée automatiquent par symfony dans la méthode __toString() que j'ai rajouté.

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
<?php
 
/**
 * BaseProgrammeAccord
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 * 
 * @property string $referenceacc
 * @property integer $OrgaEmetteur_id
 * @property Institution $Institution
 * @property Doctrine_Collection $Formelles
 * 
 * @method string              getReferenceacc()    Returns the current record's "referenceacc" value
 * @method integer             getOrgaEmetteurId()  Returns the current record's "OrgaEmetteur_id" value
 * @method Institution         getInstitution()     Returns the current record's "Institution" value
 * @method Doctrine_Collection getFormelles()       Returns the current record's "Formelles" collection
 * @method ProgrammeAccord     setReferenceacc()    Sets the current record's "referenceacc" value
 * @method ProgrammeAccord     setOrgaEmetteurId()  Sets the current record's "OrgaEmetteur_id" value
 * @method ProgrammeAccord     setInstitution()     Sets the current record's "Institution" value
 * @method ProgrammeAccord     setFormelles()       Sets the current record's "Formelles" collection
 * 
 */
abstract class BaseProgrammeAccord extends sfDoctrineRecord
{
 
[....]
 
    public function __toString()
    {
	return getReferenceacc();
    }
}#BaseProgrammeAccord.php
Schema.yml correspondant :

Code :
1
2
3
4
5
6
7
8
9
10
11
ProgrammeAccord:
  tableName: Programme_accord
  columns:
    referenceacc:
      type: string(255)
    OrgaEmetteur_id:
      type: integer(8)
  relations:
    Institution:
      local: OrgaEmetteur_id
      foreignAlias: ProgrammeAccords
Une idée de la raison de ce soucis ?

Merci d'avance

Noobboy
Noobboy est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 06/07/2011, 11h39   #2
Membre chevronné
 
Avatar de Herode
 
Développeur Web
Inscription : mars 2005
Messages : 769
Détails du profil
Informations personnelles :
Localisation : France, Savoie (Rhône Alpes)

Informations professionnelles :
Activité : Développeur Web

Informations forums :
Inscription : mars 2005
Messages : 769
Points : 788
Points : 788
Il manque le pointeur de contexte $this :
Code :
1
2
3
4
5
 
    public function __toString()
    {
	return $this->getReferenceacc();
    }
devrait mieux marcher.
Herode est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 06/07/2011, 11h57   #3
Futur Membre du Club
 
Homme
Étudiant
Inscription : novembre 2008
Messages : 67
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : novembre 2008
Messages : 67
Points : 16
Points : 16
Arf ! C'est pourtant évident !

Merci à toi, je devais être complètement dans les nuages !

(2.21 Gigowatts ? :p)
Noobboy 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 03h24.


 
 
 
 
Partenaires

Hébergement Web