for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace App\Models;
use Doctrine\SkeletonMapper\Hydrator\HydratableInterface;
use Doctrine\SkeletonMapper\Mapping\ClassMetadataInterface;
use Doctrine\SkeletonMapper\Mapping\LoadMetadataInterface;
use Doctrine\SkeletonMapper\ObjectManagerInterface;
class User implements HydratableInterface, LoadMetadataInterface
{
/** @var string */
private $username;
public static function loadMetadata(ClassMetadataInterface $metadata) : void
$metadata->setIdentifier(['username']);
}
/**
* @param mixed[] $project
*/
public function hydrate(array $project, ObjectManagerInterface $objectManager) : void
$this->username = (string) $project['username'] ?? '';
public function getUsername() : string
return $this->username;