File size: 477 Bytes
6ed81b9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
class Category
{
    private $id_category;
    private $name_category;

    public function __construct($id, $name)
    {
        $this->id_category = !$id ? null : $id;
        $this->name_category = $name;
    }

    public function getAtributs() : array
    {
        return ["id_categoria" => $this->id_category, "nombre_categoria" => $this->name_category];
    }

    public function getNameCategory() : string|null
    {
        return $this->name_category;
    }
}