This repository has been archived by the owner on Nov 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
121 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php declare(strict_types=1); | ||
/** | ||
* Copyright (c) 2019. | ||
*/ | ||
|
||
namespace Metahash; | ||
|
||
use JsonSerializable; | ||
|
||
/** | ||
* Class HistoryFilters | ||
* @package Metahash | ||
*/ | ||
class HistoryFilters implements JsonSerializable | ||
{ | ||
public $isInput = false;// - Display only isInput transactions | ||
public $isOutput = false;// - Display only isOutput transactions | ||
public $isSuccess = false;// - Display only success transactions | ||
public $isForging = false;// - Display only forging transactions | ||
public $isTest = false;//- Display only test transactions | ||
public $isDelegate = false;//- Display only delegation transactions | ||
|
||
/** | ||
* @return array|mixed | ||
*/ | ||
public function jsonSerialize(): array | ||
{ | ||
$filters = \get_object_vars($this); | ||
$result = []; | ||
foreach ($filters as $filter => $value) { | ||
if ($value) { | ||
$result[$filter] = true; | ||
} | ||
} | ||
return $result; | ||
} | ||
|
||
/** | ||
* @param bool $isInput | ||
*/ | ||
public function setIsInput(bool $isInput): void | ||
{ | ||
$this->isInput = $isInput; | ||
} | ||
|
||
/** | ||
* @param bool $isOutput | ||
*/ | ||
public function setIsOutput(bool $isOutput): void | ||
{ | ||
$this->isOutput = $isOutput; | ||
} | ||
|
||
/** | ||
* @param bool $isSuccess | ||
*/ | ||
public function setIsSuccess(bool $isSuccess): void | ||
{ | ||
$this->isSuccess = $isSuccess; | ||
} | ||
|
||
/** | ||
* @param bool $isForging | ||
*/ | ||
public function setIsForging(bool $isForging): void | ||
{ | ||
$this->isForging = $isForging; | ||
} | ||
|
||
/** | ||
* @param bool $isTest | ||
*/ | ||
public function setIsTest(bool $isTest): void | ||
{ | ||
$this->isTest = $isTest; | ||
} | ||
|
||
/** | ||
* @param bool $isDelegate | ||
*/ | ||
public function setIsDelegate(bool $isDelegate): void | ||
{ | ||
$this->isDelegate = $isDelegate; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters