PHP Classes

File: src/BigExample/TaxTable.php

Recommend this page to a friend!
  Classes of Joseluis Laso   Simple PHP Memory Database   src/BigExample/TaxTable.php   Download  
File: src/BigExample/TaxTable.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Simple PHP Memory Database
Manipulate databases stored in JSON format files
Author: By
Last change: fixing CS & MD
Date: 7 years ago
Size: 481 bytes
 

Contents

Class file image Download
<?php

namespace JLaso\SimpleMemoryDb\BigExample;

use
JLaso\SimpleMemoryDb\AbstractTable;

class
TaxTable extends AbstractTable
{
    protected
$subtypes = [
       
0 => 'mandatory',
       
1 => 'optional',
       
2 => 'regulated',
       
3 => 'unknown',
    ];

    protected function
processRecord(&$record)
    {
       
$module = count($this->subtypes);
       
$record['subtype'] = $this->subtypes[intval($record['value'] * 100) % $module];

        return
true;
    }
}