Xataface  2.0alpha2
Xataface Application Framework
 All Data Structures Namespaces Files Functions Variables Groups Pages
getRelatedRecords.example2.php
Go to the documentation of this file.
1 <?php
2 require_once 'dataface-public-api.php';
3 
4 // get all related records (well at least the first 30)
5 $courses =& $student->getRelatedRecords('Courses');
6 
7 // get ALL related records - if there are 500 of them, this will return all 500
8 $courses =& $student->getRelatedRecords('Courses', 'all');
9 
10 // get all courses from Spring-05 semester
11 $courses =& $student->getRelatedRecords('Courses', 'all', "Semester='Spring-05'");
12 
13 // get all courses from Spring-05 semester, sorted on registration date
14 $courses =& $student->getRelatedRecords('Courses', 'all', "Semester='Spring-05'", "RegistrationDate");
15 
16 // get only the first 5 courses based on letter grade.
17 $courses =& $student->getRelatedRecords('Courses',
18  0 /*start*/,
19  5 /*limit*/,
20  0 /*where*/,
21  "LetterGrade");
22 
23 // get the first 5 courses of the Spring-05 semester based on letter grade
24 $courses =& $student->getRelatedRecords('Courses',
25  0 /*start*/,
26  5 /*limit*/,
27  "Semester='Spring-05'" /*where*/,
28  "LetterGrade" /*Order by*/);
29 ?>