Fix account mapper

This commit is contained in:
Dennis Eichhorn 2017-09-26 20:34:29 +02:00
parent bb3745d1b6
commit bf476cc911
2 changed files with 9 additions and 1 deletions

View File

@ -133,7 +133,7 @@ class KanbanCard implements \JsonSerializable
$this->description = $description;
}
public function getCreatedBy() : int
public function getCreatedBy()
{
return $this->createdBy;
}

View File

@ -19,6 +19,7 @@ use phpOMS\DataStorage\Database\Query\Builder;
use phpOMS\DataStorage\Database\Query\Column;
use phpOMS\DataStorage\Database\RelationType;
use Modules\Media\Models\MediaMapper;
use Modules\Admin\Models\AccountMapper;
/**
* Mapper class.
@ -51,6 +52,13 @@ class KanbanCardMapper extends DataMapperAbstract
'kanban_card_created_by' => ['name' => 'kanban_card_created_by', 'type' => 'int', 'internal' => 'createdBy'],
];
static protected $belongsTo = [
'createdBy' => [
'mapper' => AccountMapper::class,
'src' => 'kanban_card_created_by',
],
];
/**
* Has many relation.
*