usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [2/5] git commit: Added serialize method to collections
Date Sat, 01 Feb 2014 20:20:38 GMT
Added serialize method to collections


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/11917f24
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/11917f24
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/11917f24

Branch: refs/pull/45/merge
Commit: 11917f24d6d9295595c97d2414689ccecbb93fd0
Parents: 80c4ddd
Author: ryan bridges <rbridges@apigee.com>
Authored: Sat Feb 1 14:50:59 2014 -0500
Committer: ryan bridges <rbridges@apigee.com>
Committed: Sat Feb 1 14:50:59 2014 -0500

----------------------------------------------------------------------
 .../php/lib/vendor/Apigee/Usergrid/Collection.php | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/11917f24/sdks/php/lib/vendor/Apigee/Usergrid/Collection.php
----------------------------------------------------------------------
diff --git a/sdks/php/lib/vendor/Apigee/Usergrid/Collection.php b/sdks/php/lib/vendor/Apigee/Usergrid/Collection.php
index cefa43b..9b49d38 100644
--- a/sdks/php/lib/vendor/Apigee/Usergrid/Collection.php
+++ b/sdks/php/lib/vendor/Apigee/Usergrid/Collection.php
@@ -274,5 +274,21 @@ class Collection {
     }
     return FALSE;
   }
+  public function serialize(){
+    $data = array();
+    $data->type = $this->type;
+    $data->qs = $this->qs;
+    $data->iterator = $this->iterator;
+    $data->previous = $this->previous;
+    $data->next = $this->next;
+    $data->cursor = $this->cursor;
+    $data->list=[];
+    $this->reset_entity_pointer();
+    while ($this->has_next_entity()) {
+        $entity = $this->get_next_entity();
+        array_push($data->list, $entity->get_json())
+    }
+    return json_encode($data);
+  }
 
-}
\ No newline at end of file
+}


Mime
View raw message