Split dashboard into widgets. Add build errors widget.

This commit is contained in:
Stepan Strelets 2017-11-06 00:34:11 +03:00
commit 11f58d7c2b
24 changed files with 793 additions and 328 deletions

View file

@ -58,6 +58,30 @@ class ProjectStore extends Store
return null;
}
/**
* Get a single Project by Ids.
* @param int[]
* @return Project[]
*/
public function getByIds($values, $useConnection = 'read')
{
if (empty($values)) {
throw new HttpException('Values passed to ' . __FUNCTION__ . ' cannot be empty.');
}
$query = 'SELECT * FROM {{project}} WHERE {{id}} IN ('.implode(', ', array_map('intval', $values)).')';
$stmt = Database::getConnection($useConnection)->prepareCommon($query);
$rtn = [];
if ($stmt->execute()) {
while ($data = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$rtn[$data['id']] = new Project($data);
}
}
return $rtn;
}
/**
* Get multiple Project by Title.
*