for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Oc\User;
/**
* Class UserEntity
*
* @package Oc\User
*/
class UserEntity
{
* @var int
public $id;
* @var string
public $username;
public $password;
public $email;
* @var double
public $latitude;
public $longitude;
* @var bool
public $isActive;
public $firstname;
public $lastname;
public $country;
public $language;
* Checks if the entity is new.
* @return bool
public function isNew()
return $this->id === null;
}
* Sets all properties from array.
* @param array $data
public function fromArray(array $data)
foreach ($data as $key => $value) {
if (!property_exists($this, $key)) {
continue;
$this->{$key} = $value;
* Returns all properties as array.
* @return array
public function toArray()
return get_object_vars($this);