Use global namespace+minor fixes

This commit is contained in:
Dennis Eichhorn 2019-02-04 22:29:55 +01:00
parent 65dacc3b50
commit 7d65bc0ee6
5 changed files with 25 additions and 3 deletions

View File

@ -317,7 +317,7 @@ class Task implements \JsonSerializable
/**
* Get created by
*
* @return mixed
* @return int|\phpOMS\Account\Account
*
* @since 1.0.0
*/

View File

@ -138,7 +138,7 @@ class TaskElement implements \JsonSerializable
}
/**
* @return mixed
* @return int|\phpOMS\Account\Account
*
* @since 1.0.0
*/

View File

@ -53,6 +53,11 @@ final class TaskElementMapper extends DataMapperAbstract
*
* @var array<string, array<string, null|string>>
* @since 1.0.0
*/ /**
* Has many relation.
*
* @var array<string, array<string, string>>
* @since 1.0.0
*/
protected static $hasMany = [
'media' => [
@ -63,6 +68,12 @@ final class TaskElementMapper extends DataMapperAbstract
],
];
/**
* Belongs to.
*
* @var array<string, array<string, string>>
* @since 1.0.0
*/
protected static $belongsTo = [
'createdBy' => [
'mapper' => AccountMapper::class,

View File

@ -59,6 +59,11 @@ final class TaskMapper extends DataMapperAbstract
*
* @var array<string, array<string, null|string>>
* @since 1.0.0
*/ /**
* Has many relation.
*
* @var array<string, array<string, string>>
* @since 1.0.0
*/
protected static $hasMany = [
'taskElements' => [
@ -81,6 +86,12 @@ final class TaskMapper extends DataMapperAbstract
],
];
/**
* Belongs to.
*
* @var array<string, array<string, string>>
* @since 1.0.0
*/
protected static $belongsTo = [
'createdBy' => [
'mapper' => AccountMapper::class,

View File

@ -21,7 +21,7 @@ use \Modules\Tasks\Models\TaskStatus;
$task = $this->getData('task');
$taskMedia = $task->getMedia();
$elements = $task->getTaskElements();
$cElements = count($elements);
$cElements = \count($elements);
$forwarded = $task->getCreatedBy()->getId();
$color = $this->getStatus($task->getStatus());