Skip to content

Commit

Permalink
Update Projects.php
Browse files Browse the repository at this point in the history
Add min_access_level
  • Loading branch information
VBeytok authored and MykolaiKorniat committed Jan 23, 2019
1 parent b807e73 commit e9f6d35
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions lib/Gitlab/ApiV3/Projects.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class Projects extends \Gitlab\Api\AbstractApi
{
const GUEST_ACCESS_LEVEL = 10;
const ORDER_BY = 'created_at';
const SORT = 'asc';

Expand All @@ -25,18 +26,28 @@ public function all($page = 1, $per_page = self::PER_PAGE, $order_by = self::ORD
/**
* @param int $page
* @param int $per_page
* @param int $min_access_level
* @param string $order_by
* @param string $sort
* @return mixed
*/
public function accessible($page = 1, $per_page = self::PER_PAGE, $order_by = self::ORDER_BY, $sort = self::SORT)
{
return $this->get('projects', array(
'page' => $page,
'per_page' => $per_page,
'order_by' => $order_by,
'sort' => $sort
));
public function accessible(
$page = 1,
$per_page = self::PER_PAGE,
$min_access_level = self::GUEST_ACCESS_LEVEL,
$order_by = self::ORDER_BY,
$sort = self::SORT
) {
return $this->get(
'projects?membership=true',
array(
'page' => $page,
'per_page' => $per_page,
'min_access_level' => $min_access_level,
'order_by' => $order_by,
'sort' => $sort
)
);
}

/**
Expand Down

0 comments on commit e9f6d35

Please sign in to comment.