<?php

namespace inter\mysqlStruct;

use inter\utils\Names;

class Table
{
    private $name;
    /** @var Column[] */
    private array $columns;

    public function SetName(string $val): self
    {
        $this->name = $val;
        return $this;
    }

    public function AddColumn(Column $val): self
    {
        $this->columns[] = $val;
        return $this;
    }

    public function  GetName(): string
    {
        return $this->name;
    }

    // 驼峰
    public function GetNameForHump(): string
    {
        return ucfirst(Names::Camelize($this->name));
    }

    /**
     * @return Column[]
     */
    public function GetColumns(): array
    {
        return $this->columns;
    }
}
