for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* File was created 26.04.2016 17:55
*/
namespace PeekAndPoke\Component\Slumber\Data\Addon\UserRecord;
use PeekAndPoke\Component\Slumber\Annotation\Slumber;
* @author Karsten J. Gerber <[email protected]>
class UserRecord
{
* @var string
*
* @Slumber\AsString()
private $userId;
private $name;
private $role;
private $ip;
private $userAgent;
* Use this to store a hashed version of the users session id.
* For security reason it is HIGHLY recommended to NOT store the real session id.
private $sessionHash;
* @return string
public function __toString()
/** @noinspection MagicMethodsValidityInspection */
return implode(
', ',
[
$this->name,
$this->userId,
$this->role,
$this->ip,
$this->userAgent,
]
);
}
public function getUserId()
return $this->userId;
* @param string $userId
* @return $this
public function setUserId($userId)
$this->userId = $userId;
return $this;
public function getName()
return $this->name;
* @param string $name
public function setName($name)
$this->name = $name;
public function getRole()
return $this->role;
* @param string $role
public function setRole($role)
$this->role = $role;
public function getIp()
return $this->ip;
* @param string $ip
public function setIp($ip)
$this->ip = $ip;
public function getUserAgent()
return $this->userAgent;
* @param string $userAgent
public function setUserAgent($userAgent)
$this->userAgent = $userAgent;
public function getSessionHash() : string
return $this->sessionHash;
* @param string $sessionHash
public function setSessionHash(string $sessionHash)
$this->sessionHash = $sessionHash;