Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Poirier2018-08-15 19:27:10 +0000
committerEric Poirier2018-10-03 17:36:26 +0000
commitb259518447cc774a581862f3d6aa0377e7e8e994 (patch)
tree84c0e3227416a01d735364e06ad11faa3f72e199
parent50e1377bd3cf9c64a5e0f87d9253f7ffdad9ea15 (diff)
downloadeclipse.org-common-b259518447cc774a581862f3d6aa0377e7e8e994.tar.gz
eclipse.org-common-b259518447cc774a581862f3d6aa0377e7e8e994.tar.xz
eclipse.org-common-b259518447cc774a581862f3d6aa0377e7e8e994.zip
Bug 519829 - Create a rest class for members
Change-Id: I611200f21ca3c1c198dc45467b55954cf6c67035 Signed-off-by: Eric Poirier <eric.poirier@eclipse-foundation.org>
-rw-r--r--classes/rest/member.class.php71
1 files changed, 71 insertions, 0 deletions
diff --git a/classes/rest/member.class.php b/classes/rest/member.class.php
new file mode 100644
index 00000000..0795c11a
--- /dev/null
+++ b/classes/rest/member.class.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Copyright (c) 2018 Eclipse Foundation.
+ *
+ * This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License 2.0
+ * which is available at https://www.eclipse.org/legal/epl-2.0/
+ *
+ * Contributors:
+ * Eric Poirier (Eclipse Foundation) - Initial implementation
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+
+
+require_once ('lib/eclipseussblob.class.php');
+
+/**
+ * Member class
+ *
+ * Usage example:
+ *
+ * include_once('member.class.php');
+ * $Member = new Member();
+ * $Member->loginSSO();
+ *
+ * @author chrisguindon
+ */
+class Member extends EclipseUSSBlob {
+
+ /**
+ * Class constructor
+ */
+ function __construct(App $App = NULL) {
+ parent::__construct($App);
+ }
+
+ /**
+ * Fetch all members
+ *
+ * @param array params
+ *
+ * return array
+ */
+ public function indexMember($params = array()) {
+ $url = 'foundation/member';
+ if (!empty($params)) {
+ $query = http_build_query($params);
+ $url .= "?" . $query;
+ }
+
+ $response = $this->get($url);
+ return $response;
+ }
+
+ /**
+ * Retrieve a member based on the organization id
+ *
+ * @param string $organization_id
+ *
+ * @return array
+ */
+ public function retrieveMember($organization_id = "") {
+ if (!is_numeric($organization_id)) {
+ return array();
+ }
+ $response = $this->get('foundation/member/' . $organization_id);
+ $this->unsetHeader('If-Match');
+ return $response;
+ }
+} \ No newline at end of file

Back to the top