<?php
namespace App\Presentation;
use Oberon\Bundle\PresentationBundle\Presentation\BasePresentation;
use App\Entity\User;
use Symfony\Component\DependencyInjection\ContainerInterface;
class UserPresentation extends BasePresentation
{
protected $user;
public function __construct(User $user, $scope = null, array $data = null, ContainerInterface $container = null)
{
$this->user = $user;
parent::__construct($scope, $data, $container);
}
public function getPresentation()
{
return [
'username' => $this->user->getUsername(),
'email' => $this->user->getEmail(),
'id' => (int)$this->user->getId(),
];
}
}