Adding Docblocks throughout the project and lowering the missing docblock limit in phpci.yml to zero.

Closes #692
This commit is contained in:
Dan Cryer 2014-12-08 11:25:33 +00:00
commit 7f9a09fa29
83 changed files with 1283 additions and 69 deletions

View file

@ -20,11 +20,24 @@ class BuildMetaStoreBase extends Store
protected $modelName = '\PHPCI\Model\BuildMeta';
protected $primaryKey = 'id';
/**
* Get a BuildMeta by primary key.
* @param mixed $value Primary key.
* @param string $useConnection Connection to use (read / write)
* @return \PHPCI\Model\BuildMeta|null
*/
public function getByPrimaryKey($value, $useConnection = 'read')
{
return $this->getById($value, $useConnection);
}
/**
* Get a BuildMeta by Id.
* @param mixed $value.
* @param string $useConnection Connection to use (read / write)
* @throws \b8\Exception\HttpException
* @return \PHPCI\Model\BuildMeta|null;
*/
public function getById($value, $useConnection = 'read')
{
if (is_null($value)) {
@ -44,6 +57,14 @@ class BuildMetaStoreBase extends Store
return null;
}
/**
* Get an array of BuildMeta by ProjectId.
* @param mixed $value.
* @param int $limit
* @param string $useConnection Connection to use (read / write)
* @throws \b8\Exception\HttpException
* @return \PHPCI\Model\BuildMeta[]
*/
public function getByProjectId($value, $limit = null, $useConnection = 'read')
{
if (is_null($value)) {
@ -56,6 +77,7 @@ class BuildMetaStoreBase extends Store
$add .= ' LIMIT ' . $limit;
}
$count = null;
$query = 'SELECT * FROM `build_meta` WHERE `project_id` = :project_id' . $add;
$stmt = Database::getConnection($useConnection)->prepare($query);
@ -69,15 +91,20 @@ class BuildMetaStoreBase extends Store
};
$rtn = array_map($map, $res);
$count = count($rtn);
return array('items' => $rtn, 'count' => $count);
} else {
return array('items' => array(), 'count' => 0);
}
}
/**
* Get an array of BuildMeta by BuildId.
* @param mixed $value.
* @param int $limit
* @param string $useConnection Connection to use (read / write)
* @throws \b8\Exception\HttpException
* @return \PHPCI\Model\BuildMeta[]
*/
public function getByBuildId($value, $limit = null, $useConnection = 'read')
{
if (is_null($value)) {
@ -90,6 +117,7 @@ class BuildMetaStoreBase extends Store
$add .= ' LIMIT ' . $limit;
}
$count = null;
$query = 'SELECT * FROM `build_meta` WHERE `build_id` = :build_id' . $add;
$stmt = Database::getConnection($useConnection)->prepare($query);
@ -103,9 +131,6 @@ class BuildMetaStoreBase extends Store
};
$rtn = array_map($map, $res);
$count = count($rtn);
return array('items' => $rtn, 'count' => $count);
} else {
return array('items' => array(), 'count' => 0);