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
<?php
namespace hji\users\entities;
class UserProfile
{
protected $id;
protected $provider;
protected $photo;
protected $displayName;
protected $firstName;
protected $lastName;
protected $email;
protected $gender;
protected $language;
public function __construct($data = null)
{
$data = (array)$data;
$this->id = (isset($data['id']) && !empty($data['id'])) ? $data['id'] : null;
$this->provider = (isset($data['provider']) && !empty($data['provider'])) ? $data['provider'] : null;
$this->photo = (isset($data['photo']) && !empty($data['photo'])) ? $data['photo'] : null;
$this->displayName = (isset($data['displayName']) && !empty($data['displayName'])) ? $data['displayName'] : null;
$this->firstName = (isset($data['firstName']) && !empty($data['firstName'])) ? $data['firstName'] : null;
$this->lastName = (isset($data['lastName']) && !empty($data['lastName'])) ? $data['lastName'] : null;
$this->email = (isset($data['email']) && !empty($data['email'])) ? $data['email'] : null;
$this->gender = (isset($data['gender']) && !empty($data['gender'])) ? $data['gender'] : null;
$this->language = (isset($data['language']) && !empty($data['language'])) ? $data['language'] : null;
}
public function __get($property)
{
if (isset($this->$property))
{
return $this->$property;
}
}
}