-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadUser.php
33 lines (30 loc) · 1.09 KB
/
readUser.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Read User</title>
</head>
<body>
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
if ($_GET) {
require_once 'bootstrap.php';
$array_return = array('success' => 1);
//$user = $entityManager->getRepository('User')->findBy(array('idUser' => $_GET['id_user']));
$user = $entityManager->find('User',$_GET['id_user']);
$entityManager->flush(); // Executes all deletions.
$entityManager->clear(); // Detaches all objects from Doctrine!
$array_events = array();
foreach ($user->getIdEvent() as $key => $value) {
$array_events[$key]['nome'] = $value->getName();
$array_events[$key]['description'] = $value->getDescription();
}
$array_return['events'] = $array_events;
echo json_encode($array_return);
}
?>
<br>
<!-- <a href="formCreate.php">Adicionar um novo usuário</a> -->
</body>
</html>