<?php

namespace Blazemedia\Affiliation\Rendering\Utils;

class LinksDataInPage {
     
    private static $instance;

    private array $programs = [];
    private array $subjects = [];
    private array $themes   = [];

    private function __construct() { }

    public static function getInstance() {
        if (!self::$instance) {
            self::$instance = new self();
        }

        return self::$instance;
    }


    public function addPrograms( array $programs ) : void {

        $this->programs = array_unique( array_merge( $this->programs, $programs ) );
    }

    public function addSubjects( array $subjects ) : void {

        $this->subjects = array_unique( array_merge( $this->subjects, $subjects ) );
    }

    public function addThemes( array $themes ) : void {

        $this->themes = array_unique( array_merge( $this->themes, $themes ) );
    }


    public function getPrograms() : array {

        return $this->programs;
    }

    public function getSubjects() : array {

        return $this->subjects;
    }

    public function getThemes() : array {

        return $this->themes;
    }

}