diff --git a/Api/CmsBlockRepositoryInterface.php b/Api/CmsBlockRepositoryInterface.php index 0b0162f40c9c98e9a8e96dfa0e08761ea42c48e8..66f10a0bb0e529587890627fe955301282ef20b4 100644 --- a/Api/CmsBlockRepositoryInterface.php +++ b/Api/CmsBlockRepositoryInterface.php @@ -27,4 +27,4 @@ interface CmsBlockRepositoryInterface * @return array */ public function getByTitle(string $title): array; -} \ No newline at end of file +} diff --git a/Model/Query/GetCmsBlockByTitle.php b/Model/Query/GetCmsBlockByTitle.php index 8b81467c85bcc5865896b7215c42a5dbee4a0166..d8584b28ba3ac40dcf31a4723f9747ef8b9486bb 100644 --- a/Model/Query/GetCmsBlockByTitle.php +++ b/Model/Query/GetCmsBlockByTitle.php @@ -50,4 +50,4 @@ class GetCmsBlockByTitle return $blockData; } -} \ No newline at end of file +} diff --git a/Model/Repository/CmsBlockRepository.php b/Model/Repository/CmsBlockRepository.php index 43111bc807b6c23a4c3cb85e6d03437e46708c33..8e94b5f0947ac3796a3d0f8c71cd8731f352a1f2 100644 --- a/Model/Repository/CmsBlockRepository.php +++ b/Model/Repository/CmsBlockRepository.php @@ -48,12 +48,8 @@ class CmsBlockRepository implements CmsBlockRepositoryInterface public function getByTitle(string $title): array { $connection = $this->resource->getConnection(); - $tableName = $this->resource->getTableName(self::CMS_BLOCK_TABLE_NAME); + $select = $connection->select()->from(self::CMS_BLOCK_TABLE_NAME)->where('title = :', $title); - $sqlQuery = "SELECT * FROM $tableName WHERE title = :title"; - $bind = ['title' => $title]; - - $result = $connection->fetchRow($sqlQuery, $bind); - return $result ?: []; + return $connection->fetchRow($select); } -} \ No newline at end of file +}