This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
szurubooru/src/Dao/EntityConverters/GlobalParamEntityConverter.php
2014-10-18 18:48:27 +02:00

23 lines
534 B
PHP

<?php
namespace Szurubooru\Dao\EntityConverters;
class GlobalParamEntityConverter extends AbstractEntityConverter implements IEntityConverter
{
public function toArray(\Szurubooru\Entities\Entity $entity)
{
return
[
'id' => $entity->getId(),
'key' => $entity->getKey(),
'value' => $entity->getValue(),
];
}
public function toBasicEntity(array $array)
{
$entity = new \Szurubooru\Entities\GlobalParam($array['id']);
$entity->setKey($array['key']);
$entity->setValue($array['value']);
return $entity;
}
}