Created
March 17, 2015 19:33
-
-
Save sc0ttkclark/a823a3abeea0faf55834 to your computer and use it in GitHub Desktop.
PodsCast 2 demo code
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 | |
// Setup Speakers pod | |
$speaker = pods( 'speaker' ); | |
// Find all Speakers | |
// with Lessons that are in the Series "That Series" | |
// or that have a Lesson "Awesome Lesson" | |
$params = array( | |
'where' => ' | |
lessons.series.post_title = "That Series" | |
OR lessons.post_title = "Awesome Lesson" | |
' | |
); | |
// Find the data | |
$speaker->find( $params ); | |
// Setup Series pod | |
$series = pods( 'series' ); | |
// Find all Series | |
// with Speaker "Scott Kingsley Clark" | |
// or that have a Lesson "Awesome Lesson" | |
$params = array( | |
'where' => ' | |
lessons.speaker.post_title = "Scott Kingsley Clark" | |
OR lessons.post_title = "Awesome Lesson" | |
' | |
); | |
// Find the data | |
$series->find( $params ); | |
// Setup Lessons pod | |
$lessons = pods( 'lesson' ); | |
// Find all Lessons | |
// with Speaker "Scott Kingsley Clark" | |
// or with Series "That Series" | |
$params = array( | |
'where' => ' | |
speaker.post_title = "Scott Kingsley Clark" | |
OR series.post_title = "That Series" | |
' | |
); | |
// Find the data | |
$lessons->find( $lessons ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment