mirror of
https://github.com/doctrine/doctrine-website.git
synced 2026-03-23 22:32:11 +01:00
44 lines
1022 B
PHP
44 lines
1022 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Doctrine\Website\Model;
|
|
|
|
use Doctrine\SkeletonMapper\Hydrator\HydratableInterface;
|
|
use Doctrine\SkeletonMapper\Mapping\ClassMetadataInterface;
|
|
use Doctrine\SkeletonMapper\Mapping\LoadMetadataInterface;
|
|
use Doctrine\SkeletonMapper\ObjectManagerInterface;
|
|
|
|
class DoctrineUser implements HydratableInterface, LoadMetadataInterface
|
|
{
|
|
/** @var string */
|
|
private $name;
|
|
|
|
/** @var string */
|
|
private $url;
|
|
|
|
public static function loadMetadata(ClassMetadataInterface $metadata) : void
|
|
{
|
|
$metadata->setIdentifier(['name']);
|
|
}
|
|
|
|
/**
|
|
* @param mixed[] $doctrineUser
|
|
*/
|
|
public function hydrate(array $doctrineUser, ObjectManagerInterface $objectManager) : void
|
|
{
|
|
$this->name = (string) $doctrineUser['name'];
|
|
$this->url = (string) $doctrineUser['url'];
|
|
}
|
|
|
|
public function getName() : string
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
public function getUrl() : string
|
|
{
|
|
return $this->url;
|
|
}
|
|
}
|