* @package product * @version $Id: $ * @link http://www.zentao.net */ class gitlabModel extends model { /** * Get a gitlab by id. * * @param int $id * @access public * @return object */ public function getByID($id) { return $this->loadModel('pipeline')->getByID($id); } /** * Get gitlab list. * * @param string $orderBy * @param object $pager * @access public * @return array */ public function getList($orderBy = 'id_desc', $pager = null) { return $this->loadModel('pipeline')->getList('gitlab', $orderBy, $pager); } /** * Get gitlab pairs * * @return array */ public function getPairs() { return $this->loadModel('pipeline')->getPairs('gitlab'); } /** * Create a gitlab. * * @access public * @return bool */ public function create() { return $this->loadModel('pipeline')->create('gitlab'); } /** * Update a gitlab. * * @param int $id * @access public * @return bool */ public function update($id) { return $this->loadModel('pipeline')->update($id); } /** * Get gitlab token permissions. * * @param string $host * @param string $token * @access public * @return array */ public function getPermissionsByToken($host, $token) { $host = rtrim($host, '/'); $host .= '/api/v4/activities'; $results = json_decode(file_get_contents($host . "?private_token=$token")); return $results; } }