11 namespace Fossology\UI\Api\Models;
24 const ALLOWED_KEYS = [
'sha1',
'sha256',
'md5',
'size'];
67 $this->size = intval(
$size);
131 $inputKeys = array_keys($inputArray);
132 $intersectKeys = array_intersect($inputKeys, self::ALLOWED_KEYS);
133 if (count($inputKeys) > 0 && count($intersectKeys) != count($inputKeys)) {
136 if (array_key_exists(
'sha1', $inputArray)) {
137 $sha1 = $inputArray[
'sha1'];
139 if (array_key_exists(
'md5', $inputArray)) {
140 $md5 = $inputArray[
'md5'];
142 if (array_key_exists(
'sha256', $inputArray)) {
143 $sha256 = $inputArray[
'sha256'];
145 if (array_key_exists(
'size', $inputArray)) {
146 $size = $inputArray[
'size'];
Hash model holding information about file like checksums and size.
static createFromArray($inputArray)
__construct($sha1=null, $md5=null, $sha256=null, $size=null)