diff --git a/Admin/Install/Application/QA/Application.php b/Admin/Install/Application/QA/Application.php index b54b56d..6982bf6 100755 --- a/Admin/Install/Application/QA/Application.php +++ b/Admin/Install/Application/QA/Application.php @@ -151,7 +151,7 @@ final class Application $account = $this->loadAccount($request); - if (!($account instanceof NullAccount)) { + if ($account->id > 0) { $response->header->l11n = $account->l11n; } elseif ($this->app->sessionManager->get('language') !== null && $response->header->l11n->getLanguage() !== $this->app->sessionManager->get('language') @@ -161,6 +161,8 @@ final class Application $this->app->sessionManager->get('language'), $this->app->sessionManager->get('country') ?? '*' ); + } else { + $this->app->setResponseLanguage($request, $response, $this->config); } if (!\in_array($response->getLanguage(), $this->config['language'])) { diff --git a/Admin/Settings/Theme/Backend/settings.tpl.php b/Admin/Settings/Theme/Backend/settings.tpl.php index e6143ac..7e53c25 100755 --- a/Admin/Settings/Theme/Backend/settings.tpl.php +++ b/Admin/Settings/Theme/Backend/settings.tpl.php @@ -59,7 +59,7 @@ echo $this->getData('nav')->render(); ?> foreach ($apps as $key => $app) : ++$count; $url = UriFactory::build('{/base}/admin/module/settings?id=QA&app=' . $app->id); ?> - getId(); ?> + id; ?> printHtml($app->name); ?> diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 480fc46..fd43954 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -344,11 +344,11 @@ final class ApiController extends Controller /** @var \Modules\QA\Models\QAAnswer $oldAccepted */ $oldAccepted = QAAnswerMapper::get() - ->where('question', $old->question->getId()) + ->where('question', $old->question->id) ->where('isAccepted', true) ->execute(); - if ($old->getId() !== $oldAccepted->getId()) { + if ($old->id !== $oldAccepted->id) { $oldUnaccepted = clone $oldAccepted; $oldUnaccepted->isAccepted = !$oldUnaccepted->isAccepted; @@ -474,7 +474,7 @@ final class ApiController extends Controller ->where('createdBy', $request->header->account) ->execute(); - if ($questionVote === false || $questionVote instanceof NullQAQuestionVote || $questionVote === null) { + if ($questionVote->id === 0) { /** @var \Modules\QA\Models\QAQuestion $question */ $question = QAQuestionMapper::get()->where('id', (int) $request->getData('id'))->execute(); @@ -482,7 +482,7 @@ final class ApiController extends Controller $new->score = (int) $request->getData('type'); $new->question = (int) $request->getData('id'); $new->createdBy = new NullAccount($request->header->account); - $new->createdFor = $question->createdBy->getId(); + $new->createdFor = $question->createdBy->id; $this->createModel($request->header->account, $new, QAQuestionVoteMapper::class, 'qa_question_vote', $request->getOrigin()); $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Vote', 'Sucessfully voted.', $new); @@ -549,7 +549,7 @@ final class ApiController extends Controller ->where('createdBy', $request->header->account) ->execute(); - if ($answerVote === false || $answerVote instanceof NullQAAnswerVote || $answerVote === null) { + if ($answerVote->id === 0) { /** @var \Modules\QA\Models\QAAnswer $answer */ $answer = QAAnswerMapper::get()->where('id', (int) $request->getData('id'))->execute(); @@ -557,7 +557,7 @@ final class ApiController extends Controller $new->score = (int) $request->getData('type'); $new->answer = (int) $request->getData('id'); $new->createdBy = new NullAccount($request->header->account); - $new->createdFor = $answer->createdBy->getId(); + $new->createdFor = $answer->createdBy->id; $this->createModel($request->header->account, $new, QAAnswerVoteMapper::class, 'qa_answer_vote', $request->getOrigin()); $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Vote', 'Sucessfully voted.', $new); diff --git a/Models/QAAnswer.php b/Models/QAAnswer.php index 81df700..ae28a33 100755 --- a/Models/QAAnswer.php +++ b/Models/QAAnswer.php @@ -34,7 +34,7 @@ class QAAnswer implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Status. @@ -42,7 +42,7 @@ class QAAnswer implements \JsonSerializable * @var int * @since 1.0.0 */ - private int $status = QAAnswerStatus::ACTIVE; + public int $status = QAAnswerStatus::ACTIVE; /** * Answer. @@ -187,7 +187,7 @@ class QAAnswer implements \JsonSerializable public function getAccountVoteScore(int $account) : int { foreach ($this->votes as $vote) { - if ($vote->createdBy->getId() === $account) { + if ($vote->createdBy->id === $account) { return $vote->score; } } diff --git a/Models/QAAnswerVote.php b/Models/QAAnswerVote.php index b24d90e..8b00583 100755 --- a/Models/QAAnswerVote.php +++ b/Models/QAAnswerVote.php @@ -33,7 +33,7 @@ class QAAnswerVote * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Account. diff --git a/Models/QAApp.php b/Models/QAApp.php index 99e8f25..6f6eda0 100755 --- a/Models/QAApp.php +++ b/Models/QAApp.php @@ -30,7 +30,7 @@ class QAApp implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Application name. diff --git a/Models/QAQuestion.php b/Models/QAQuestion.php index 5f5ec17..10de8e4 100755 --- a/Models/QAQuestion.php +++ b/Models/QAQuestion.php @@ -37,7 +37,7 @@ class QAQuestion implements \JsonSerializable * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Title. @@ -53,7 +53,7 @@ class QAQuestion implements \JsonSerializable * @var int * @since 1.0.0 */ - private int $status = QAQuestionStatus::ACTIVE; + public int $status = QAQuestionStatus::ACTIVE; /** * Question. @@ -77,7 +77,7 @@ class QAQuestion implements \JsonSerializable * @var string * @since 1.0.0 */ - private string $language = ISO639x1Enum::_EN; + public string $language = ISO639x1Enum::_EN; /** * Created by. @@ -166,10 +166,10 @@ class QAQuestion implements \JsonSerializable public function getAccounts() : array { $accounts = []; - $accounts[] = $this->createdBy->account->getId(); + $accounts[] = $this->createdBy->account->id; foreach ($this->answers as $answer) { - $accounts[] = $answer->createdBy->account->getId(); + $accounts[] = $answer->createdBy->account->id; } return \array_unique($accounts); @@ -378,7 +378,7 @@ class QAQuestion implements \JsonSerializable public function getAccountVoteScore(int $account) : int { foreach ($this->votes as $vote) { - if ($vote->createdBy->getId() === $account) { + if ($vote->createdBy->id === $account) { return $vote->score; } } diff --git a/Models/QAQuestionVote.php b/Models/QAQuestionVote.php index 398d693..6f47244 100755 --- a/Models/QAQuestionVote.php +++ b/Models/QAQuestionVote.php @@ -33,7 +33,7 @@ class QAQuestionVote * @var int * @since 1.0.0 */ - protected int $id = 0; + public int $id = 0; /** * Account. diff --git a/Theme/Backend/qa-dashboard.tpl.php b/Theme/Backend/qa-dashboard.tpl.php index 6cd5900..3505cf7 100755 --- a/Theme/Backend/qa-dashboard.tpl.php +++ b/Theme/Backend/qa-dashboard.tpl.php @@ -28,7 +28,7 @@ echo $this->getData('nav')->render(); ?> @@ -51,7 +51,7 @@ echo $this->getData('nav')->render(); ?>
- printHtml($question->name); ?> + printHtml($question->name); ?>
@@ -62,9 +62,9 @@ echo $this->getData('nav')->render(); ?> - + printHtml($question->createdBy->account->name2); ?> printHtml($question->createdBy->account->name1); ?> - createdBy->image !== null && !($question->createdBy->image instanceof NullMedia)) : ?> + createdBy->image->id > 0) : ?> <?= $this->getHtml('AccountImage', '0', '0'); ?> diff --git a/Theme/Backend/qa-question.tpl.php b/Theme/Backend/qa-question.tpl.php index 625f448..f891a65 100755 --- a/Theme/Backend/qa-question.tpl.php +++ b/Theme/Backend/qa-question.tpl.php @@ -37,7 +37,7 @@ echo $this->getData('nav')->render(); { "key": 1, "listener": "click", "action": [ {"key": 1, "type": "event.prevent"}, - {"key": 2, "type": "message.request", "uri": "getId());?>&type=1", "method": "PUT", "request_type": "json"} + {"key": 2, "type": "message.request", "uri": "id);?>&type=1", "method": "PUT", "request_type": "json"} ] } ]' href="#"> @@ -49,7 +49,7 @@ echo $this->getData('nav')->render(); { "key": 1, "listener": "click", "action": [ {"key": 1, "type": "event.prevent"}, - {"key": 2, "type": "message.request", "uri": "getId());?>&type=-1", "method": "PUT", "request_type": "json"} + {"key": 2, "type": "message.request", "uri": "id);?>&type=-1", "method": "PUT", "request_type": "json"} ] } ]' href="#"> @@ -75,16 +75,16 @@ echo $this->getData('nav')->render(); getMedia(); foreach ($files as $file) : ?> - name; ?> + name; ?> - +
printHtml($question->createdBy->account->name2); ?> printHtml($question->createdBy->account->name1); ?>
-
Score: createdBy->account->getId()] ?? 0; ?>
+
Score: createdBy->account->id] ?? 0; ?>
- createdBy->image !== null && !($question->createdBy->image instanceof NullMedia)) : ?> + createdBy->image->id > 0) : ?> <?= $this->getHtml('AccountImage', '0', '0'); ?>
@@ -101,11 +101,11 @@ echo $this->getData('nav')->render();
getMedia(); foreach ($files as $file) : ?> - name; ?> + name; ?> - diff --git a/Theme/Backend/qa-tag-list.tpl.php b/Theme/Backend/qa-tag-list.tpl.php index 19d4943..8ec157b 100755 --- a/Theme/Backend/qa-tag-list.tpl.php +++ b/Theme/Backend/qa-tag-list.tpl.php @@ -32,9 +32,9 @@ echo $this->getData('nav')->render(); $value) : ++$c; - $url = \phpOMS\Uri\UriFactory::build('{/base}/admin/account/settings?{?}&id=' . $value->getId()); ?> + $url = \phpOMS\Uri\UriFactory::build('{/base}/admin/account/settings?{?}&id=' . $value->id); ?> - getId(); ?> + id; ?> printHtml($value->name); ?> diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 1916d1f..61830c9 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -109,7 +109,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase $request->setData('name', 'TestQAApp'); $this->module->apiQAAppCreate($request, $response); - self::assertGreaterThan(0, $response->get('')['response']->getId()); + self::assertGreaterThan(0, $response->get('')['response']->id); } /** @@ -161,7 +161,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase $request->setData('media', \json_encode([1])); $this->module->apiQAQuestionCreate($request, $response); - self::assertGreaterThan(0, $response->get('')['response']->getId()); + self::assertGreaterThan(0, $response->get('')['response']->id); } /** @@ -211,7 +211,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase $request->setData('media', \json_encode([1])); $this->module->apiQAAnswerCreate($request, $response); - self::assertGreaterThan(0, $response->get('')['response']->getId()); + self::assertGreaterThan(0, $response->get('')['response']->id); } /** @@ -228,7 +228,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase $request->setData('accepted', '1'); $this->module->apiChangeAnsweredStatus($request, $response); - self::assertGreaterThan(0, $response->get('')['response']->getId()); + self::assertGreaterThan(0, $response->get('')['response']->id); } /** @@ -261,7 +261,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase $request->setData('type', '-1'); $this->module->apiChangeQAQuestionVote($request, $response); - self::assertGreaterThan(0, $response->get('')['response']->getId()); + self::assertGreaterThan(0, $response->get('')['response']->id); $response = new HttpResponse(); $request = new HttpRequest(new HttpUri('')); @@ -271,7 +271,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase $request->setData('type', '1'); $this->module->apiChangeQAQuestionVote($request, $response); - self::assertGreaterThan(0, $response->get('')['response']->getId()); + self::assertGreaterThan(0, $response->get('')['response']->id); } /** @@ -304,7 +304,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase $request->setData('type', '-1'); $this->module->apiChangeQAAnswerVote($request, $response); - self::assertGreaterThan(0, $response->get('')['response']->getId()); + self::assertGreaterThan(0, $response->get('')['response']->id); $response = new HttpResponse(); $request = new HttpRequest(new HttpUri('')); @@ -314,7 +314,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase $request->setData('type', '1'); $this->module->apiChangeQAAnswerVote($request, $response); - self::assertGreaterThan(0, $response->get('')['response']->getId()); + self::assertGreaterThan(0, $response->get('')['response']->id); } /** diff --git a/tests/Models/NullQAAnswerTest.php b/tests/Models/NullQAAnswerTest.php index 593b5b1..2e18c9a 100755 --- a/tests/Models/NullQAAnswerTest.php +++ b/tests/Models/NullQAAnswerTest.php @@ -37,6 +37,6 @@ final class NullQAAnswerTest extends \PHPUnit\Framework\TestCase public function testId() : void { $null = new NullQAAnswer(2); - self::assertEquals(2, $null->getId()); + self::assertEquals(2, $null->id); } } diff --git a/tests/Models/NullQAAnswerVoteTest.php b/tests/Models/NullQAAnswerVoteTest.php index e51f393..616f626 100755 --- a/tests/Models/NullQAAnswerVoteTest.php +++ b/tests/Models/NullQAAnswerVoteTest.php @@ -37,6 +37,6 @@ final class NullQAAnswerVoteTest extends \PHPUnit\Framework\TestCase public function testId() : void { $null = new NullQAAnswerVote(2); - self::assertEquals(2, $null->getId()); + self::assertEquals(2, $null->id); } } diff --git a/tests/Models/NullQAAppTest.php b/tests/Models/NullQAAppTest.php index 0e2541f..0650fd5 100755 --- a/tests/Models/NullQAAppTest.php +++ b/tests/Models/NullQAAppTest.php @@ -37,6 +37,6 @@ final class NullQAAppTest extends \PHPUnit\Framework\TestCase public function testId() : void { $null = new NullQAApp(2); - self::assertEquals(2, $null->getId()); + self::assertEquals(2, $null->id); } } diff --git a/tests/Models/NullQAQuestionTest.php b/tests/Models/NullQAQuestionTest.php index e53dc25..50665f5 100755 --- a/tests/Models/NullQAQuestionTest.php +++ b/tests/Models/NullQAQuestionTest.php @@ -37,6 +37,6 @@ final class NullQAQuestionTest extends \PHPUnit\Framework\TestCase public function testId() : void { $null = new NullQAQuestion(2); - self::assertEquals(2, $null->getId()); + self::assertEquals(2, $null->id); } } diff --git a/tests/Models/NullQAQuestionVoteTest.php b/tests/Models/NullQAQuestionVoteTest.php index f8e7705..178af48 100755 --- a/tests/Models/NullQAQuestionVoteTest.php +++ b/tests/Models/NullQAQuestionVoteTest.php @@ -37,6 +37,6 @@ final class NullQAQuestionVoteTest extends \PHPUnit\Framework\TestCase public function testId() : void { $null = new NullQAQuestionVote(2); - self::assertEquals(2, $null->getId()); + self::assertEquals(2, $null->id); } } diff --git a/tests/Models/QAAnswerMapperTest.php b/tests/Models/QAAnswerMapperTest.php index 0782a18..912f30a 100755 --- a/tests/Models/QAAnswerMapperTest.php +++ b/tests/Models/QAAnswerMapperTest.php @@ -42,14 +42,14 @@ final class QAAnswerMapperTest extends \PHPUnit\Framework\TestCase $answer->isAccepted = true; $id = QAAnswerMapper::create()->execute($answer); - self::assertGreaterThan(0, $answer->getId()); - self::assertEquals($id, $answer->getId()); + self::assertGreaterThan(0, $answer->id); + self::assertEquals($id, $answer->id); - $answerR = QAAnswerMapper::get()->with('createdBy')->with('account')->where('id', $answer->getId())->execute(); + $answerR = QAAnswerMapper::get()->with('createdBy')->with('account')->where('id', $answer->id)->execute(); self::assertEquals($answer->answer, $answerR->answer); - self::assertEquals($answer->question->getId(), $answerR->question->getId()); + self::assertEquals($answer->question->id, $answerR->question->id); self::assertEquals($answer->getStatus(), $answerR->getStatus()); self::assertEquals($answer->isAccepted, $answerR->isAccepted); - self::assertEquals($answer->createdBy->account->getId(), $answerR->createdBy->account->getId()); + self::assertEquals($answer->createdBy->account->id, $answerR->createdBy->account->id); } } diff --git a/tests/Models/QAAnswerTest.php b/tests/Models/QAAnswerTest.php index adc8fad..61e0d69 100755 --- a/tests/Models/QAAnswerTest.php +++ b/tests/Models/QAAnswerTest.php @@ -41,12 +41,12 @@ final class QAAnswerTest extends \PHPUnit\Framework\TestCase */ public function testDefault() : void { - self::assertEquals(0, $this->answer->getId()); + self::assertEquals(0, $this->answer->id); self::assertEquals('', $this->answer->answer); - self::assertEquals(0, $this->answer->question->getId()); + self::assertEquals(0, $this->answer->question->id); self::assertFalse($this->answer->isAccepted); self::assertEquals(QAAnswerStatus::ACTIVE, $this->answer->getStatus()); - self::assertEquals(0, $this->answer->createdBy->getId()); + self::assertEquals(0, $this->answer->createdBy->id); self::assertEquals(0, $this->answer->getVoteScore()); self::assertEquals(0, $this->answer->getAccountVoteScore(0)); self::assertEquals([], $this->answer->getMedia()); diff --git a/tests/Models/QAAnswerVoteMapperTest.php b/tests/Models/QAAnswerVoteMapperTest.php index 08aacc8..ebb4c94 100755 --- a/tests/Models/QAAnswerVoteMapperTest.php +++ b/tests/Models/QAAnswerVoteMapperTest.php @@ -37,10 +37,10 @@ final class QAAnswerVoteMapperTest extends \PHPUnit\Framework\TestCase $vote->createdFor = 2; $id = QAAnswerVoteMapper::create()->execute($vote); - self::assertGreaterThan(0, $vote->getId()); - self::assertEquals($id, $vote->getId()); + self::assertGreaterThan(0, $vote->id); + self::assertEquals($id, $vote->id); - $voteR = QAAnswerVoteMapper::get()->where('id', $vote->getId())->execute(); + $voteR = QAAnswerVoteMapper::get()->where('id', $vote->id)->execute(); self::assertEquals($vote->answer, $voteR->answer); self::assertEquals($vote->score, $voteR->score); @@ -50,7 +50,7 @@ final class QAAnswerVoteMapperTest extends \PHPUnit\Framework\TestCase ->where('createdBy', 1) ->limit(1) ->execute() - ->getId() + ->id ); } } diff --git a/tests/Models/QAAnswerVoteTest.php b/tests/Models/QAAnswerVoteTest.php index c39ce2b..f028ca7 100755 --- a/tests/Models/QAAnswerVoteTest.php +++ b/tests/Models/QAAnswerVoteTest.php @@ -37,7 +37,7 @@ final class QAAnswerVoteTest extends \PHPUnit\Framework\TestCase */ public function testDefault() : void { - self::assertEquals(0, $this->vote->getId()); + self::assertEquals(0, $this->vote->id); self::assertEquals(0, $this->vote->answer); self::assertEquals(0, $this->vote->score); } diff --git a/tests/Models/QAAppTest.php b/tests/Models/QAAppTest.php index 32bda72..910021f 100755 --- a/tests/Models/QAAppTest.php +++ b/tests/Models/QAAppTest.php @@ -37,7 +37,7 @@ final class QAAppTest extends \PHPUnit\Framework\TestCase */ public function testDefault() : void { - self::assertEquals(0, $this->app->getId()); + self::assertEquals(0, $this->app->id); self::assertEquals('', $this->app->name); } diff --git a/tests/Models/QAQuestionMapperTest.php b/tests/Models/QAQuestionMapperTest.php index d069654..914f4ae 100755 --- a/tests/Models/QAQuestionMapperTest.php +++ b/tests/Models/QAQuestionMapperTest.php @@ -40,14 +40,14 @@ final class QAQuestionMapperTest extends \PHPUnit\Framework\TestCase $question->setLanguage('en'); $id = QAQuestionMapper::create()->execute($question); - self::assertGreaterThan(0, $question->getId()); - self::assertEquals($id, $question->getId()); + self::assertGreaterThan(0, $question->id); + self::assertEquals($id, $question->id); - $questionR = QAQuestionMapper::get()->with('createdBy')->with('createdBy/account')->where('id', $question->getId())->execute(); + $questionR = QAQuestionMapper::get()->with('createdBy')->with('createdBy/account')->where('id', $question->id)->execute(); self::assertEquals($question->name, $questionR->name); self::assertEquals($question->question, $questionR->question); self::assertEquals($question->getStatus(), $questionR->getStatus()); self::assertEquals($question->getLanguage(), $questionR->getLanguage()); - self::assertEquals($question->createdBy->account->getId(), $questionR->createdBy->account->getId()); + self::assertEquals($question->createdBy->account->id, $questionR->createdBy->account->id); } } diff --git a/tests/Models/QAQuestionTest.php b/tests/Models/QAQuestionTest.php index e92287f..ecd0b3d 100755 --- a/tests/Models/QAQuestionTest.php +++ b/tests/Models/QAQuestionTest.php @@ -45,13 +45,13 @@ final class QAQuestionTest extends \PHPUnit\Framework\TestCase */ public function testDefault() : void { - self::assertEquals(0, $this->question->getId()); + self::assertEquals(0, $this->question->id); self::assertEquals('', $this->question->name); self::assertEquals('', $this->question->question); self::assertEquals('', $this->question->questionRaw); self::assertEquals(QAQuestionStatus::ACTIVE, $this->question->getStatus()); self::assertEquals(ISO639x1Enum::_EN, $this->question->getLanguage()); - self::assertEquals(0, $this->question->createdBy->getId()); + self::assertEquals(0, $this->question->createdBy->id); self::assertInstanceOf('\DateTimeImmutable', $this->question->createdAt); self::assertFalse($this->question->hasAccepted()); self::assertEquals([0 => 0], $this->question->getAccounts()); // includes createdBy diff --git a/tests/Models/QAQuestionVoteMapperTest.php b/tests/Models/QAQuestionVoteMapperTest.php index 40e8dce..935b505 100755 --- a/tests/Models/QAQuestionVoteMapperTest.php +++ b/tests/Models/QAQuestionVoteMapperTest.php @@ -37,10 +37,10 @@ final class QAQuestionVoteMapperTest extends \PHPUnit\Framework\TestCase $vote->createdFor = 2; $id = QAQuestionVoteMapper::create()->execute($vote); - self::assertGreaterThan(0, $vote->getId()); - self::assertEquals($id, $vote->getId()); + self::assertGreaterThan(0, $vote->id); + self::assertEquals($id, $vote->id); - $voteR = QAQuestionVoteMapper::get()->where('id', $vote->getId())->execute(); + $voteR = QAQuestionVoteMapper::get()->where('id', $vote->id)->execute(); self::assertEquals($vote->question, $voteR->question); self::assertEquals($vote->score, $voteR->score); @@ -49,7 +49,7 @@ final class QAQuestionVoteMapperTest extends \PHPUnit\Framework\TestCase ->where('question', 1) ->where('createdBy', 1) ->limit(1) - ->execute()->getId() + ->execute()->id ); } } diff --git a/tests/Models/QAQuestionVoteTest.php b/tests/Models/QAQuestionVoteTest.php index 45cfe70..f0bc071 100755 --- a/tests/Models/QAQuestionVoteTest.php +++ b/tests/Models/QAQuestionVoteTest.php @@ -37,7 +37,7 @@ final class QAQuestionVoteTest extends \PHPUnit\Framework\TestCase */ public function testDefault() : void { - self::assertEquals(0, $this->vote->getId()); + self::assertEquals(0, $this->vote->id); self::assertEquals(0, $this->vote->question); self::assertEquals(0, $this->vote->score); }