szurubooru/src/Dao/UserDao.php

17 lines
430 B
PHP
Raw Normal View History

<?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);
}
}