CORE-POS/IS4C

View on GitHub
pos/is4c-nf/lib/DynamicKey.php

Summary

Maintainability
A
0 mins
Test Coverage
F
55%
<?php

namespace COREPOS\pos\lib;
use \JsonSerializable;

class DynamicKey
{
    private $label = '??';
    private $entry = '';
    private $append = true;
    private $submit = true;
    
    public function __construct($label, $entry, $append=true, $submit=true)
    {
        $this->label = $label;
        $this->entry = $entry;
        $this->append = $append;
        $this->submit = $submit;
    }

    public function jsonSerialize()
    {
        return array(
            'label' => $this->label,
            'entry' => $this->entry,
            'append' => $this->append ? true : false,
            'submit' => $this->submit ? true : false,
        );
    }
}