Welcome Guest, Not a member yet? Register   Sign In
DataMapper help please
#1

[eluser]Asinox[/eluser]
Hi guys, im using for first time DataMapper, but i think that im lost within, im trying to make a query in the old style

Code:
$sql = "SELECT * FROM cines_salas AS cs, peliculas_salas AS s, salas as sal, cines AS c WHERE cs.cine_id = '".$row->id."' AND  s.pelicula_id = '".$query->id."' AND sal.id = s.sala_id AND c.id = cs.cine_id";

$salas->query($sql);

//$query->id, and $row->id COME FROM OTHER QUERY

But why i cant ask for a relationship field with a "if"?, after the query i want to ask something like this:
Code:
foreach($salas->all as $s)
if($row->id == $s->cine_id){
   // do something
}

but i cant...


i dont know if my relationship are wrong

im trying to finish a "movie website" (just playing time and review), so i have this relationship

1.- Movie have many Theater
2.- Movie have many Room's
3.- Theater have many Room's
4.- Room have many Day's
5.- Day have many Hours

All thing with DataMapper is fine, very nice, but here is my problem to access the relation data from Movie and Theare and Room's

Some help please?

Thanks, sorry with my English.






Thanks guys,




Theme © iAndrew 2016 - Forum software by © MyBB