<?php

namespace App\Manager\Toolbar\Definition;

use App\Manager\Toolbar\Element\ToolbarElement;

abstract class Toolbar
{
    private array $leftGroup = [];
    private array $rightGroup = [];

    public function addToLeftGroup(ToolbarElement $element): self
    {
        $this->leftGroup[] = $element;
        return $this;
    }

    public function addToRightGroup(ToolbarElement $element): self
    {
        $this->rightGroup[] = $element;
        return $this;
    }

    public function getGroups(): array
    {
        return [
            'leftGroup' => $this->leftGroup,
            'rightGroup' => $this->rightGroup,
        ];
    }
}
