Vra

entiteit:

 class Pharmacie{    
      public $distance;

     public function getDistance() {
          // calculate distance here 
          return $distance; 
    }

}

en in die beheerder:

 public function listePharmsGeoAction()
{
    $em = $this->getDoctrine()->getEntityManager();


    $pharmas = $em->getRepository('CentraleFrontBundle:Pharmacie')
                   ->createQueryBuilder('o')
                   ->orderBy('o.distance','ASC')
                   ->getQuery()
                   ->getResult();



     return $this->render('CentraleFrontBundle:SiteFront:listePharms.html.twig', array(
        'pharmas' => $pharmas));
}

Fout: [Semantiese fout] Lyn 0, Col 65 Naby 'Distance ASC': Fout: Klas Centrale Frontbundle Entity Pharmacie het geen veld of assosiasie met die naam afstand nie

Was dit nuttig?

Oplossing

  • Dit is 'n slegte praktyk om navraag direk in u beheerder te skep; u moet funksie in u bewaarplek skep
  • Afstandseiendom moet beskerm word of privaat nie publiek nie
  • waar is jou kartering ???
Gelisensieer onder: CC-BY-SA met toeskrywing
Nie verbonde aan StackOverflow
scroll top