17 lines
430 B
PHP
17 lines
430 B
PHP
|
<?php
|
||
|
namespace Szurubooru\Dao;
|
||
|
|
||
|
class UserDao extends AbstractDao implements ICrudDao
|
||
|
{
|
||
|
public function __construct(\Szurubooru\DatabaseConnection $databaseConnection)
|
||
|
{
|
||
|
parent::__construct($databaseConnection, 'users', '\Szurubooru\Entities\User');
|
||
|
}
|
||
|
|
||
|
public function getByName($userName)
|
||
|
{
|
||
|
$arrayEntity = $this->collection->findOne(['name' => $userName]);
|
||
|
return $this->entityConverter->toEntity($arrayEntity);
|
||
|
}
|
||
|
}
|