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-11-09 17:38:58 +01:00

24 lines
553 B
PHP

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