<?php
namespace Fifa\ConnectId\Sdk\Util\Initializer;

/**
 * Class PersonRegistrationsType
 * @package Fifa\ConnectId\Sdk\Util\Initializer
 */
trait PersonRegistrationsType
{
    /**
     * Initializes PersonRegistrationsType with default values
     */
    public function initialize()
    {
        $this->container['player_registrations'] = self::getDefaultValue($this->container['player_registrations']);
        $this->container['match_official_registrations'] = self::getDefaultValue($this->container['match_official_registrations']);
        $this->container['team_official_registrations'] = self::getDefaultValue($this->container['team_official_registrations']);
        $this->container['organisation_official_registrations'] = self::getDefaultValue($this->container['organisation_official_registrations']);
    }

    /**
     * @param array|null $input
     * @return array
     */
    private static function getDefaultValue(?array $input): array
    {
        return is_null($input) ? array() : $input;
    }
}