Xataface 2.0
Xataface Application Framework
docs/examples/getRelatedRecords.example2.php
Go to the documentation of this file.
00001 <?
00002 require_once 'dataface-public-api.php';
00003 
00004 // get all related records (well at least the first 30)
00005 $courses =& $student->getRelatedRecords('Courses');
00006 
00007 // get ALL related records  - if there are 500 of them, this will return all 500
00008 $courses =& $student->getRelatedRecords('Courses', 'all');
00009 
00010 // get all courses from Spring-05 semester
00011 $courses =& $student->getRelatedRecords('Courses', 'all', "Semester='Spring-05'");
00012 
00013 // get all courses from Spring-05 semester, sorted on registration date
00014 $courses =& $student->getRelatedRecords('Courses', 'all', "Semester='Spring-05'", "RegistrationDate");
00015 
00016 // get only the first 5 courses based on letter grade.
00017 $courses =& $student->getRelatedRecords('Courses', 
00018                                         0 /*start*/, 
00019                                         5 /*limit*/,
00020                                         0 /*where*/,
00021                                         "LetterGrade");
00022 
00023 // get the first 5 courses of the Spring-05 semester based on letter grade
00024 $courses =& $student->getRelatedRecords('Courses',
00025                                         0 /*start*/,
00026                                         5 /*limit*/,
00027                                         "Semester='Spring-05'" /*where*/,
00028                                         "LetterGrade" /*Order by*/);
00029 ?>
 All Data Structures Namespaces Files Functions Variables Enumerations