php - How to exclude tables/children from result in RedBeanPHP -
i have modelled relation redbeanphp:
car id color ownpart part id name so redbean creates sql tables expected:
car id color part id name car_id this works great.
however, have other tables in db, e.g. user has car_id identifying users car.
when want query cars , children (parts) by
$cars = r::find('car'); $foo = r::exportall( $cars ); echo json_encode($foo); the json contains every user related car.
how can query cars "real" children?
exportall specifies third parameter $filter should able use specify relationships exported:
$foo = r::exportall($cars, false, array('part'));
Comments
Post a Comment