for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Jacobemerick\Web\Domain\Stream\Blog;
use Aura\Sql\ConnectionLocator;
class MysqlBlogRepository implements BlogRepositoryInterface
{
/** @var ConnectionLocator */
protected $connections;
/**
* @param ConnectonLocator $connections
*/
public function __construct(ConnectionLocator $connections)
$this->connections = $connections;
}
* @param integer $id
*
* @return array|false
public function getBlogById($id)
$query = "
SELECT *
FROM `jpemeric_stream`.`blog`
WHERE `id` = :id
LIMIT 1";
$bindings = [
'id' => $id,
];
return $this
->connections
->getRead()
->fetchOne($query, $bindings);
* @param string $title
public function getBlogByTitle($title)
WHERE `title` = :title
'title' => $title,
public function getUnmappedBlogs()
SELECT `id`, `date`
LEFT JOIN `jpemeric_stream`.`post`
ON `post`.`type_id` = `blog`.`id` AND `post`.`id` IS NULL";
->fetchAll($query);