Add travis draft some QA layouts

This commit is contained in:
Dennis Eichhorn 2018-08-11 17:30:15 +02:00
parent efb36a9e11
commit 5c7f8fe932
8 changed files with 32 additions and 1 deletions

View File

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -14,6 +14,7 @@ declare(strict_types=1);
namespace Modules\QA\Models; namespace Modules\QA\Models;
use Modules\Profile\Models\ProfileMapper;
use phpOMS\DataStorage\Database\DataMapperAbstract; use phpOMS\DataStorage\Database\DataMapperAbstract;
use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\DataStorage\Database\Query\Builder;
use phpOMS\DataStorage\Database\Query\Column; use phpOMS\DataStorage\Database\Query\Column;
@ -69,4 +70,17 @@ class QAAnswerMapper extends DataMapperAbstract
* @since 1.0.0 * @since 1.0.0
*/ */
protected static $primaryField = 'qa_answer_id'; protected static $primaryField = 'qa_answer_id';
/**
* Belongs to.
*
* @var array<string, array<string, string>>
* @since 1.0.0
*/
protected static $belongsTo = [
'createdBy' => [
'mapper' => ProfileMapper::class,
'dest' => 'qa_answer_created_by',
],
];
} }

View File

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

View File

@ -14,6 +14,7 @@ declare(strict_types=1);
namespace Modules\QA\Models; namespace Modules\QA\Models;
use Modules\Profile\Models\ProfileMapper;
use phpOMS\DataStorage\Database\DataMapperAbstract; use phpOMS\DataStorage\Database\DataMapperAbstract;
use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\DataStorage\Database\Query\Builder;
use phpOMS\DataStorage\Database\Query\Column; use phpOMS\DataStorage\Database\Query\Column;
@ -81,6 +82,19 @@ class QAQuestionMapper extends DataMapperAbstract
], ],
]; ];
/**
* Belongs to.
*
* @var array<string, array<string, string>>
* @since 1.0.0
*/
protected static $belongsTo = [
'createdBy' => [
'mapper' => ProfileMapper::class,
'dest' => 'qa_question_created_by',
],
];
/** /**
* Primary table. * Primary table.
* *

View File

@ -12,6 +12,9 @@ echo $this->getData('nav')->render();
<div class="inner"> <div class="inner">
<?= $this->printHtml($question->getQuestion()); ?> <?= $this->printHtml($question->getQuestion()); ?>
</div> </div>
<div class="inner">
<img alt="<?= $this->getHtml('AccountImage', 0, 0); ?>" data-lazyload="<?= UriFactory::build('/' . $question->getCreatedBy()->getImage()->getPath()); ?>">
</div>
</section> </section>
</div> </div>
</div> </div>