daily pastebin goal
39%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 234 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. <?php
  2.  
  3. $entries = SCAR::get('authors')
  4.                 ->byEmail($emails)
  5.             ->entries()
  6.                 ->byPostTime('>=', $one_week_ago)
  7.                 ->byId(
  8.                     SCAR::get('tags')->byName($tag)
  9.                     );
  10.  
  11. foreach ($entries as $entry) {
  12.     echo "ENTRY $entry->id titled $entry->title\n";
  13.     echo "Posted $entry->post_time by ".$entry->authors()->email."\n";
  14.     echo "Tagged With:\n";
  15.     foreach ($entry->tags() as $tag) {
  16.         echo "$tag->name\n";
  17.     }
  18.     echo "Body: $entry->body\n\n\n\n";
  19. }
  20.  
  21. ?>
  22. QUERIES:
  23. string(93) "QUERY: SELECT * FROM `authors` WHERE `email` IN ('jakob@felocity.org', 'jakob@notlocity.org')"
  24. string(52) "QUERY: SELECT * FROM `tags` WHERE `name` = 'awesome'"
  25. string(56) "QUERY: SELECT * FROM `entries_tags` WHERE `tag_id` = '1'"
  26. string(122) "QUERY: SELECT * FROM `entries` WHERE `author_id` IN ('1', '2') AND `post_time` >= '1203908504' AND `id` IN ('2', '6', '8')"
  27. string(58) "QUERY: SELECT * FROM `entries_tags` WHERE `entry_id` = '2'"
  28. string(44) "QUERY: SELECT * FROM `tags` WHERE `id` = '2'"
  29. string(58) "QUERY: SELECT * FROM `entries_tags` WHERE `entry_id` = '6'"
  30. string(58) "QUERY: SELECT * FROM `entries_tags` WHERE `entry_id` = '8'"
  31.  
  32. OUTPUT:
  33. ENTRY 2 titled foo entry
  34. Posted 1204419391 by jakob@felocity.org
  35. Tagged With: awesome, cool
  36. Body: fo fo fo fo fooooooo
  37.  
  38. ---
  39.  
  40. ENTRY 6 titled random entry 131204357303
  41. Posted 1204419391 by jakob@felocity.org
  42. Tagged With:
  43. awesome
  44. Body: this is a random entry for 821204357303
  45.  
  46. ---
  47.  
  48. ENTRY 8 titled random entry 811204357823
  49. Posted 1204419391 by jakob@felocity.org
  50. Tagged With:
  51. awesome
  52. cool
  53. Body: this is a random entry for 901204357823
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top