Last active
October 4, 2019 23:00
-
-
Save govaniso/8668a43cf9bf385ff3ec8295cfba9c7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Todos los dispositovos prestamos a un alumno | |
$Alumnos = new Alumnos(); | |
$alumno = $Alumnos->find(1); | |
$prestamos = $alumno->getPrestamos(); | |
foreach($prestamos as $p): | |
echo $p->fecha_prestamo; | |
$items = $p->getItems(); | |
foreach($items as $i): | |
echo $i->getDispositivo()->nombre; | |
echo $i->cantidad; | |
echo $i->getDispositivo()->getTipo()->tipo; | |
echo $i->getDispositivo()->getPlaca()->placa; | |
endforeach; | |
endforeach; | |
// Todos los prestamos de los dispositivos de un Tipo determininado | |
$DispositovosTipo = new DispositovosTipo(); | |
$tipo = DispositovosTipo(1); | |
$dispositivos = $tipo->getDispositivos(); | |
foreach($dispositivos as $d){ | |
echo $d->nombre; // nombre dispositivo | |
foreach($d->prestamosItems as $i){ | |
echo $i->cantidad; | |
echo $i->getPrestamo()->fecha_prestamo; | |
echo $i->getPrestamo()->getAlumno()->nombre; | |
echo $i->getPrestamo()->getAlumno()->no_control; | |
$alumno = $i->getPrestamo()->getAlumno(); | |
echo $alumno->nombre; | |
echo $alumno->no_control; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment