<?php
namespace Dreamfox\DeliveryDate\Premium;

class OtherSetting
{

  private $_required;
  private $_showEmptyOnCheckout;
  private $_labelOnCheckout;
  private $_descriptionOnCheckout;

  public function __construct($data)
  {
    if ($data) {
      $this->setRequired($data->required);
      $this->setShowEmptyOnCheckout($data->showEmptyOnCheckout);
      $this->setLabelOnCheckout($data->labelOnCheckout);
      $this->setDescriptionOnCheckout($data->descriptionOnCheckout);
    }
  }

  public function setRequired($value)
  {
    $this->_required = (boolean)$value;
  }

  public function getRequired()
  {
    return $this->_required;
  }

  public function setShowEmptyOnCheckout($value)
  {
    $this->_showEmptyOnCheckout = (boolean)$value;
  }

  public function getShowEmptyOnCheckout()
  {
    return $this->_showEmptyOnCheckout;
  }

  public function setLabelOnCheckout($value)
  {
    $this->_labelOnCheckout = $value;
  }

  public function getLabelOnCheckout()
  {
    return $this->_labelOnCheckout;
  }

  public function setDescriptionOnCheckout($value)
  {
    $this->_descriptionOnCheckout = $value;
  }

  public function getDescriptionOnCheckout()
  {
    return $this->_descriptionOnCheckout;
  }

  public function toArray()
  {
    return [
      'required' => $this->getRequired(),
      'showEmptyOnCheckout' => $this->getShowEmptyOnCheckout(),
      'labelOnCheckout' => $this->getLabelOnCheckout(),
      'descriptionOnCheckout' => $this->getDescriptionOnCheckout(),
    ];
  }
}