svn: /web/presentations/trunk/slides/wepay/ groups6.xml
| From: | Rasmus Lerdorf | Date: | Sat, 13 Nov 2010 18:22:27 +0000 |
| Subject: | svn: /web/presentations/trunk/slides/wepay/ groups6.xml | ||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-1687@lists.php.net to get a copy of this message | ||
rasmus Sat, 13 Nov 2010 18:22:27 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=305324
Log:
Avoid an error here
Changed paths:
U web/presentations/trunk/slides/wepay/groups6.xml
Modified: web/presentations/trunk/slides/wepay/groups6.xml
===================================================================
--- web/presentations/trunk/slides/wepay/groups6.xml 2010-11-13 17:31:13 UTC (rev 305323)
+++ web/presentations/trunk/slides/wepay/groups6.xml 2010-11-13 18:22:27 UTC (rev 305324)
@@ -6,9 +6,13 @@
$W = new WePay($access_token, $token_secret);
$group_id = apc_fetch('group_id');
$trs = $W->get("/group/transactions/$group_id");
-$id = $trs[0]->id;
-$tr = $W->get("/transaction/$id");
-print_r($tr);
+if(count($trs)) {
+ $id = $trs[0]->id;
+ $tr = $W->get("/transaction/$id");
+ print_r($tr);
+} else {
+ echo "No transaction yet";
+}
]]></example>
</slide>