Symfony 1.4 and propel 1.6

Discussion relating to version 1.3.x and 1.4.x

Symfony 1.4 and propel 1.6

Postby bashman » Wed Jun 19, 2013 8:50 am

The query;

Code: Select all
  $c = PacientesQuery::create()
            ->add(PacientesPeer::ID, 1 )
            ->addAsColumn("nom", "(".PacientesPeer::NOMBRES.")")
            ->addAsColumn("barra", "(".OrdenesPeer::ID.")")
            ->addAsColumn("tipo_pacientes", "(".TipoPacientesPeer::NOMBRE.")")
            ->addAsColumn("secciones", "(".AreasPruebasPeer::NOMBRE.")")
            ->addAsColumn("analyz", "(".AnalyPeer::NOMBRE.")")           
            ->addJoin(PacientesPeer::ID, OrdenesPeer::PACIENTE_ID)
            ->addJoin(PacientesPeer::TIPO_PACIENTE_ID, TipoPacientesPeer::ID)
            ->addJoin(OrdenesPeer::AREA_PRUEBA_ID, AreasPruebasPeer::ID)
            ->addJoin(OrdenesPeer::ANALIZADOR_ID, AnalizadoresPeer::ID);
           
$pager = $request->getParameter('page', 1); // first page by default
$this->pager = new PropelPager($c, 'PacientesPeer', 'doSelect', $page =1, $rowsPerPage = 10);


Generates:

Code: Select all
SELECT (pacientes.NOMBRES) AS nom, (ordenes.ID) AS barra, (tipo_pacientes.NOMBRE) AS tipo_pacientes, (areas_pruebas.NOMBRE) AS secciones, (analizadores.NOMBRE) AS analizadores FROM `pacientes` INNER JOIN `ordenes` ON (pacientes.ID=ordenes.PACIENTE_ID) INNER JOIN `tipo_pacientes` ON (pacientes.TIPO_PACIENTE_ID=tipo_pacientes.ID) INNER JOIN `areas_pruebas` ON (ordenes.AREA_PRUEBA_ID=areas_pruebas.ID) INNER JOIN `analyz` ON (ordenes.ANALY_ID=analy.ID) WHERE pacientes.ID=1 LIMIT 10


Work fine.

But in te view, (foreach)

Code: Select all
   foreach ($pager as $p)
   {
//    echo "xxx";
       }

Notice:  Undefined offset: 5 in /home/bashman/public_html/diagnosys/lib/model/om/BasePacientes.php on line 768
Notice:  Undefined offset: 6 in /home/bashman/public_html/diagnosys/lib/model/om/BasePacientes.php on line 769
Notice:  Undefined offset: 7 in /home/bashman/public_html/diagnosys/lib/model/om/BasePacientes.php on line 770
Notice:  Undefined offset: 8 in /home/bashman/public_html/diagnosys/lib/model/om/BasePacientes.php on line 771
...



If I try to do something then

Code: Select all
Fatal error:  Cannot use object of type sfOutputEscaperObjectDecorator as array


In which I wrong?.
missing something? ...
The late nights I got fried?...

Thanks.
Jose Luis Regalado
Linux user 280.381
http://bashman.wordpress.com
bashman
Junior Member
 
Posts: 3
Joined: Wed Aug 06, 2008 9:50 pm

Return to symfony 1.3 and 1.4

Who is online

Users browsing this forum: No registered users and 6 guests