<?php
namespace PortalPeople\DisabledDates\Block;

use Magento\Framework\View\Element\Template;
use PortalPeople\DisabledDates\Model\ResourceModel\DisabledDate\CollectionFactory;
use PortalPeople\DisabledDates\Model\Config;

class Calendar extends Template
{
    protected $collectionFactory;
    protected $config;

    public function __construct(
        Template\Context $context,
        CollectionFactory $collectionFactory,
        Config $config,
        array $data = []
    ) {
        $this->collectionFactory = $collectionFactory;
        $this->config = $config;
        parent::__construct($context, $data);
    }

    public function getDisabledDates()
    {
        $collection = $this->collectionFactory->create();
        return $collection->getColumnValues('date');
    }

    public function getDisabledWeekdays(): array
    {
        return $this->config->getDisabledWeekdays();
    }
}
