add todos from github

This commit is contained in:
Dennis Eichhorn 2019-12-31 19:54:45 +01:00
parent fc3111cf5c
commit f114844f29
4 changed files with 18 additions and 12 deletions

View File

@ -24,10 +24,11 @@
"type": "TINYINT(1)",
"null": false
},
"tag_created_by": {
"name": "tag_created_by",
"tag_owner": {
"name": "tag_owner",
"type": "INT",
"null": false,
"null": true,
"default": null,
"foreignTable": "account",
"foreignKey": "account_id"
}

View File

@ -28,6 +28,10 @@ use phpOMS\Model\Message\FormValidation;
* @license OMS License 1.0
* @link https://orange-management.org
* @since 1.0.0
*
* @todo Orange-Management/Modules#153
* Create Module
* Create a badge module instead of letting modules create their own internal badge/tag system.
*/
final class ApiController extends Controller
{

View File

@ -56,7 +56,7 @@ class Tag implements ArrayableInterface, \JsonSerializable
* @var int
* @since 1.0.0
*/
protected $createdBy = 0;
protected $owner = 0;
/**
* Tag type.
@ -69,13 +69,13 @@ class Tag implements ArrayableInterface, \JsonSerializable
/**
* Get created by
*
* @return int|\phpOMS\Account\Account
* @return null|int|\phpOMS\Account\Account
*
* @since 1.0.0
*/
public function getCreatedBy()
public function getOwner()
{
return $this->createdBy;
return $this->owner;
}
/**
@ -87,9 +87,9 @@ class Tag implements ArrayableInterface, \JsonSerializable
*
* @since 1.0.0
*/
public function setCreatedBy($id) : void
public function setOwner($id) : void
{
$this->createdBy = $id;
$this->owner = $id;
}
/**

View File

@ -15,6 +15,7 @@ declare(strict_types=1);
namespace Modules\Tag\Models;
use phpOMS\DataStorage\Database\DataMapperAbstract;
use Modules\Admin\Models\AccountMapper;
/**
* Tag mapper class.
@ -38,7 +39,7 @@ final class TagMapper extends DataMapperAbstract
'tag_color' => ['name' => 'tag_color', 'type' => 'string', 'internal' => 'color'],
'tag_type' => ['name' => 'tag_type', 'type' => 'int', 'internal' => 'type'],
'tag_color' => ['name' => 'tag_color', 'type' => 'string', 'internal' => 'color'],
'tag_created_by' => ['name' => 'tag_created_by', 'type' => 'int', 'internal' => 'createdBy'],
'tag_owner' => ['name' => 'tag_owner', 'type' => 'int', 'internal' => 'owner'],
];
/**
@ -48,9 +49,9 @@ final class TagMapper extends DataMapperAbstract
* @since 1.0.0
*/
protected static array $belongsTo = [
'createdBy' => [
'owner' => [
'mapper' => AccountMapper::class,
'src' => 'tag_created_by',
'src' => 'tag_owner',
],
];