<?php


/***
 * Represent a list with accepted payment methods
 */
class PagSeguroAcceptedPaymentMethods
{

    /**
     * @var
     */
    private $acceptedPaymentsList;

    /**
     * @param array|null $config
     */
    public function __construct(array $config = null)
    {
        if (!is_null($config) && count($config) > 0) {
            $this->setConfig($config);
        }
    }

    /**
     * @param PagSeguroAcceptedPayments $acceptedPayments
     */
    public function addConfig(PagSeguroAcceptedPayments $acceptedPayments)
    {
        $this->acceptedPaymentsList[] = $acceptedPayments;
    }

    /**
     * @param array $config
     */
    public function setConfig(array $config)
    {
        $this->acceptedPaymentsList = $config;
    }

    /**
     * @return array
     */
    public function getConfig()
    {
        if ($this->acceptedPaymentsList == null) {
            $this->acceptedPaymentsList = array();
        }
        return $this->acceptedPaymentsList;
    }
}
