<?php

class Phone implements \JsonSerializable
{
    /**
    * @var integer
    */
    private $type;	

    private $ddi;	
    private $ddd;	
    private $number;	
    private $extension;	

    public function jsonSerialize(): mixed
    {
        $obj = clone $this;
        $keys = get_object_vars($obj);
        foreach ($keys as $key => $value) {
            if ($value===null || $value==='') {
                unset($obj->{$key});
            }
        }

        return get_object_vars($obj);
    }    

    /**
     * Get the value of type
     */ 
    public function getType()
    {
        return $this->type;
    }

    /**
     * Set the value of type
     *
     * @return  self
     */ 
    public function setType($type)
    {
        $this->type = $type;

        return $this;
    }

    /**
     * Get the value of ddi
     */ 
    public function getDdi()
    {
        return $this->ddi;
    }

    /**
     * Set the value of ddi
     *
     * @return  self
     */ 
    public function setDdi($ddi)
    {
        $this->ddi = $ddi;

        return $this;
    }

    /**
     * Get the value of ddd
     */ 
    public function getDdd()
    {
        return $this->ddd;
    }

    /**
     * Set the value of ddd
     *
     * @return  self
     */ 
    public function setDdd($ddd)
    {
        $this->ddd = $ddd;

        return $this;
    }

    /**
     * Get the value of number
     */ 
    public function getNumber()
    {
        return $this->number;
    }

    /**
     * Set the value of number
     *
     * @return  self
     */ 
    public function setNumber($number)
    {
        $this->number = $number;

        return $this;
    }

    /**
     * Get the value of extension
     */ 
    public function getExtension()
    {
        return $this->extension;
    }

    /**
     * Set the value of extension
     *
     * @return  self
     */ 
    public function setExtension($extension)
    {
        $this->extension = $extension;

        return $this;
    }
}