+++ /dev/null
-<?php
-
-namespace App\Controller;
-
-use App\Controller\AppController;
-use Cake\Core\Configure;
-use Cake\Network\Http\Client;
-
-/**
- * Manage the home page
- */
-class EntityController extends AppController
-{
- /**
- * Get all datas about a user
- */
- public function index()
- {
- try {
- $http = new Client();
- $response = $http->get(COMPTOIR_SRV_API . "users/view/" . $this->request->query('id'), [], ['type' => 'json']);
-
- $userDatas = $response->body('json_decode');
-
- //List of projects created by the user
- $creatorOfSoftwares = $userDatas->creatorOfSoftwares;
- //List of projects use by the user
- $userSoftwares = $userDatas->userSoftwares;
- //List of projects backe by the user
- $backerSoftwares = $userDatas->backerSoftwares;
- //List of projects witch the user contribute
- $contributorSoftwares = $userDatas->contributorSoftwares;
- //List of projects which the user provide for
- $providerForSoftwares = $userDatas->providerForSoftwares;
-
-
- } catch (Exception $exception) {
- $this->log(var_export($exception, true), "debug");
- }
-
- $this->set('user',$userDatas->user);
- $this->set('creatorOfSoftwares',$creatorOfSoftwares);
- $this->set('userSoftwares', $userSoftwares);
- $this->set('backerSoftwares',$backerSoftwares);
- $this->set('contributorSoftwares',$contributorSoftwares);
- $this->set('providerSoftwares',$providerForSoftwares);
-
- }
- public function getRelationshipsSoftwares()
- {
- try {
- $http = new Client();
- $response = $http->get(COMPTOIR_SRV_API . "relationshipsSoftwaresUsers/getRelationshipsByUserId/", $this->request->query, ['type' => 'json']);
-
- $userDatas = $response->body('json_decode');
-
-
- $relationshipsSoftwaresUser = $userDatas->relationshipsSoftwaresUsers;
-
-
-
- } catch (Exception $exception) {
- $this->log(var_export($exception, true), "debug");
- }
- $this->set('relationshipsSoftwaresUser',$relationshipsSoftwaresUser);
- }
- public function backerFor()
- {
-
- }
- public function contributorOf()
- {
-
- }
-
- public function providerFor()
- {
-
- }
-}
\ No newline at end of file