Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sc0ttkclark
Created March 17, 2015 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sc0ttkclark/a823a3abeea0faf55834 to your computer and use it in GitHub Desktop.
Save sc0ttkclark/a823a3abeea0faf55834 to your computer and use it in GitHub Desktop.
PodsCast 2 demo code
<?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