
por favor ayuda con este error: call to a member fuction format() on a non-object
Publicado por gilberto (5 intervenciones) el 25/05/2016 20:14:53
por favor pido ayuda con este error: call to a member fuction format() on a non-object.
trato de crear nuevas calibraciones a instrumentos de la misma magnitud y al tratar de crar las calibraciones sale el error.

trato de crear nuevas calibraciones a instrumentos de la misma magnitud y al tratar de crar las calibraciones sale el error.
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
public function nuevaAction()
{
$peticion = $this->getRequest();
$id=$peticion->request->get('id');
$fp=$peticion->request->get('fechaproxima');
$fr=$peticion->request->get('fechareal');
$em = $this->getDoctrine()->getManager();
$inst = $em->getRepository('InstrumentacionBundle:Instrumento')->findBy(array('magnitudid' => $id));
foreach ($inst as $value)
{
$Calibracion = new \Sistema\InstrumentacionBundle\Entity\Calibracion();
$Calibracion->setInstrumentoid($em->getRepository('InstrumentacionBundle:Instrumento')->find($value->getId()));
$Calibracion->setFechaproxima($fp);
$Calibracion->setFechareal($fr);
$em->persist($Calibracion);
}
$em->flush(); //ak es donde se produce el error.
return $this->render('InstrumentacionBundle:Calibracion:nueva.html.twig');
}

Valora esta pregunta


0