PHP Classes

File: src/Example/Customer.php

Recommend this page to a friend!
  Classes of Joseluis Laso   Simple PHP Memory Database   src/Example/Customer.php   Download  
File: src/Example/Customer.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: 639 bytes
 

Contents

Class file image Download
<?php

namespace JLaso\SimpleMemoryDb\Example;

use
JLaso\SimpleMemoryDb\ToArrayInterface;

class
Customer implements ToArrayInterface
{
    protected
$id;
    protected
$name;
    protected
$taxType;

   
/**
     * @param int $id
     * @param string $name
     * @param int $taxType
     */
   
public function __construct($id, $name, $taxType)
    {
       
$this->id = $id;
       
$this->name = $name;
       
$this->taxType = $taxType;
    }

    public function
toArray()
    {
        return [
           
'id' => $this->id,
           
'name' => $this->name,
           
'tax_type_id' => $this->taxType,
        ];
    }
}