Improve CS.

This commit is contained in:
Marco Vito Moscaritolo 2015-05-31 16:01:51 +02:00
commit 180bdcf4fe
6 changed files with 63 additions and 15 deletions

View file

@ -22,8 +22,10 @@ class BuildMetaStoreBase extends Store
/**
* Returns a BuildMeta model by primary key.
*
* @param mixed $value
* @param string $useConnection
*
* @return \@appNamespace\Model\BuildMeta|null
*/
public function getByPrimaryKey($value, $useConnection = 'read')
@ -33,10 +35,13 @@ class BuildMetaStoreBase extends Store
/**
* Returns a BuildMeta model by Id.
*
* @param mixed $value
* @param string $useConnection
* @throws HttpException
*
* @return \@appNamespace\Model\BuildMeta|null
*
* @throws HttpException
*/
public function getById($value, $useConnection = 'read')
{
@ -59,11 +64,14 @@ class BuildMetaStoreBase extends Store
/**
* Returns an array of BuildMeta models by ProjectId.
*
* @param mixed $value
* @param int $limit
* @param string $useConnection
* @throws HttpException
*
* @return array
*
* @throws HttpException
*/
public function getByProjectId($value, $limit = 1000, $useConnection = 'read')
{
@ -71,7 +79,6 @@ class BuildMetaStoreBase extends Store
throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.');
}
$query = 'SELECT * FROM `build_meta` WHERE `project_id` = :project_id LIMIT :limit';
$stmt = Database::getConnection($useConnection)->prepare($query);
$stmt->bindValue(':project_id', $value);
@ -95,11 +102,14 @@ class BuildMetaStoreBase extends Store
/**
* Returns an array of BuildMeta models by BuildId.
*
* @param mixed $value
* @param int $limit
* @param string $useConnection
* @throws HttpException
*
* @return array
*
* @throws HttpException
*/
public function getByBuildId($value, $limit = 1000, $useConnection = 'read')
{
@ -107,7 +117,6 @@ class BuildMetaStoreBase extends Store
throw new HttpException('Value passed to ' . __FUNCTION__ . ' cannot be null.');
}
$query = 'SELECT * FROM `build_meta` WHERE `build_id` = :build_id LIMIT :limit';
$stmt = Database::getConnection($useConnection)->prepare($query);
$stmt->bindValue(':build_id', $value);