-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUser.php
More file actions
69 lines (55 loc) · 1.57 KB
/
User.php
File metadata and controls
69 lines (55 loc) · 1.57 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* Created by Vitaly Iegorov <egorov@samsonos.com>
* on 02.03.14 at 13:19
*/
namespace samson\social;
/**
* Generic class for storing user data in local format
* @author Vitaly Egorov <egorov@samsonos.com>
* @copyright 2013 SamsonOS
* @version
*/
class User implements \samsonframework\core\RenderInterface
{
/** User given name */
public $name = '';
/** User second name */
public $surname = '';
/** User social system identifier */
public $socialID = '';
/** User email address */
public $email = '';
/** User date of birth */
public $birthday = '';
/** User gender */
public $gender = '';
/** User native language/locale */
public $locale = '';
/** User small photo */
public $photo;
/** User additional data */
public $other;
/** Transform object for view rendering */
public function toView($prefix = null, array $restricted = array())
{
return array(
$prefix.'name' => $this->name,
$prefix.'surname' => $this->surname,
$prefix.'socialID' => $this->socialID,
$prefix.'email' => $this->email,
$prefix.'birthday' => $this->birthday,
$prefix.'gender' => $this->gender,
$prefix.'locale' => $this->locale,
$prefix.'photo' => $this->photo,
$prefix.'other' => $this->other
);
}
/**
* Generic user constructor
* @param object|array $userData Entity recieved from social system
*/
public function __construct($userData = null)
{
}
}