public function getAllFields($fieldType = Field::BOTH)
{
$ret = $this->exec($this->uri, null);
$fields = $this->json_mapper->mapArray(json_decode($ret, false), new \ArrayObject(), '\\JiraRestApi\\Field\\Field');
// temp array
$ar = [];
if ($fieldType === Field::CUSTOM) {
foreach ($fields as $f) {
if ($f->custom === true) {
array_push($ar, $f);
}
}
$fields =& $ar;
} elseif ($fieldType === Field::SYSTEM) {
foreach ($fields as $f) {
if ($f->custom === false) {
array_push($ar, $f);
}
}
$fields =& $ar;
}
return $fields;
}