11 namespace Fossology\UI\Api\Models;
13 require_once dirname(dirname(dirname(dirname(__DIR__)))) .
14 '/lib/php/Plugin/FO_Plugin.php';
94 $this->
id = intval(
$id);
100 $this->accessLevel =
"read_only";
103 $this->accessLevel =
"read_write";
105 case PLUGIN_DB_CADMIN:
106 $this->accessLevel =
"clearing_admin";
109 $this->accessLevel =
"admin";
112 $this->accessLevel =
"none";
114 $this->rootFolderId = intval($root_folder_id);
115 $this->defaultGroup = is_null($default_group_fk) ? null : intval($default_group_fk);
119 $this->analysis->setUsingString($this->agents);
123 $this->defaultBucketPool =
null;
214 return json_encode($this->
getArray());
221 public function getArray($version = ApiVersion::V1)
224 $restHelper = $container->get(
'helper.restHelper');
225 $returnUser = array();
229 if ($this->email !==
null) {
233 if ($this->rootFolderId !==
null && $this->rootFolderId != 0) {
236 if ($this->defaultGroup !==
null) {
237 $returnUser[
"defaultGroup"] = $version == ApiVersion::V2 ? $restHelper->getUserDao()->getGroupNameById($this->defaultGroup) :
$this->defaultGroup;
239 if ($this->emailNotification !==
null) {
242 if ($this->agents !==
null) {
243 $returnUser[
"agents"] = $this->analysis->getArray($version);
245 if ($this->defaultBucketPool !==
null) {
Model to hold analysis settings.
Model to hold user information.
__construct($id, $name, $description, $email, $accessLevel, $root_folder_id, $emailNotification, $agents, $default_group_fk=null, $defaultBucketPool=null)
getArray($version=ApiVersion::V1)
#define PLUGIN_DB_WRITE
Plugin requires write permission on DB.
#define PLUGIN_DB_READ
Plugin requires read permission on DB.
#define PLUGIN_DB_ADMIN
Plugin requires admin level permission on DB.