<?php
/**
 * PersonRegistrationsType
 *
 * PHP version 5
 *
 * @category Class
 * @package  Fifa\ConnectId\Sdk\Api
 * @author   Swaagger Codegen team
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * FIFA Connect ID - ID Directory V6
 *
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * OpenAPI spec version: v6
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 *
 */

/**
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */

namespace Fifa\ConnectId\Sdk\Api\Model;

use \ArrayAccess;

/**
 * PersonRegistrationsType Class Doc Comment
 *
 * @category    Class
 * @package     Fifa\ConnectId\Sdk\Api
 * @author      Swagger Codegen team
 * @link        https://github.com/swagger-api/swagger-codegen
 */
class PersonRegistrationsType implements ArrayAccess
{
    use \Fifa\ConnectId\Sdk\Util\Initializer\PersonRegistrationsType;

    const DISCRIMINATOR = null;

    /**
      * The original name of the model.
      * @var string
      */
    protected static $swaggerModelName = 'PersonRegistrationsType';

    /**
      * Array of property to type mappings. Used for (de)serialization
      * @var string[]
      */
    protected static $swaggerTypes = [
        'player_registrations' => '\Fifa\ConnectId\Sdk\Api\Model\PlayerRegistrationType[]',
        'match_official_registrations' => '\Fifa\ConnectId\Sdk\Api\Model\MatchOfficialRegistrationType[]',
        'team_official_registrations' => '\Fifa\ConnectId\Sdk\Api\Model\TeamOfficialRegistrationType[]',
        'organisation_official_registrations' => '\Fifa\ConnectId\Sdk\Api\Model\OrganisationOfficialRegistrationType[]'
    ];

    public static function swaggerTypes()
    {
        return self::$swaggerTypes;
    }

    /**
     * Array of attributes where the key is the local name, and the value is the original name
     * @var string[]
     */
    protected static $attributeMap = [
        'player_registrations' => 'playerRegistrations',
        'match_official_registrations' => 'matchOfficialRegistrations',
        'team_official_registrations' => 'teamOfficialRegistrations',
        'organisation_official_registrations' => 'organisationOfficialRegistrations'
    ];

    /**
     * Array of attributes to setter functions (for deserialization of responses)
     * @var string[]
     */
    protected static $setters = [
        'player_registrations' => 'setPlayerRegistrations',
        'match_official_registrations' => 'setMatchOfficialRegistrations',
        'team_official_registrations' => 'setTeamOfficialRegistrations',
        'organisation_official_registrations' => 'setOrganisationOfficialRegistrations'
    ];

    /**
     * Array of attributes to getter functions (for serialization of requests)
     * @var string[]
     */
    protected static $getters = [
        'player_registrations' => 'getPlayerRegistrations',
        'match_official_registrations' => 'getMatchOfficialRegistrations',
        'team_official_registrations' => 'getTeamOfficialRegistrations',
        'organisation_official_registrations' => 'getOrganisationOfficialRegistrations'
    ];

    public static function attributeMap()
    {
        return self::$attributeMap;
    }

    public static function setters()
    {
        return self::$setters;
    }

    public static function getters()
    {
        return self::$getters;
    }

    /**
     * Associative array for storing property values
     * @var mixed[]
     */
    protected $container = [];

    /**
     * Constructor
     * @param mixed[] $data Associated array of property values initializing the model
     */
    public function __construct(array $data = null)
    {
        $this->container['player_registrations'] = isset($data['player_registrations']) ? $data['player_registrations'] : null;
        $this->container['match_official_registrations'] = isset($data['match_official_registrations']) ? $data['match_official_registrations'] : null;
        $this->container['team_official_registrations'] = isset($data['team_official_registrations']) ? $data['team_official_registrations'] : null;
        $this->container['organisation_official_registrations'] = isset($data['organisation_official_registrations']) ? $data['organisation_official_registrations'] : null;

        $this->initialize();
    }

    /**
     * show all the invalid properties with reasons.
     *
     * @return array invalid properties with reasons
     */
    public function listInvalidProperties()
    {
        $invalid_properties = [];

        if ($this->container['player_registrations'] === null) {
            $invalid_properties[] = "'player_registrations' can't be null";
        }
        if ($this->container['match_official_registrations'] === null) {
            $invalid_properties[] = "'match_official_registrations' can't be null";
        }
        if ($this->container['team_official_registrations'] === null) {
            $invalid_properties[] = "'team_official_registrations' can't be null";
        }
        if ($this->container['organisation_official_registrations'] === null) {
            $invalid_properties[] = "'organisation_official_registrations' can't be null";
        }
        return $invalid_properties;
    }

    /**
     * validate all the properties in the model
     * return true if all passed
     *
     * @return bool True if all properties are valid
     */
    public function valid()
    {

        if ($this->container['player_registrations'] === null) {
            return false;
        }
        if ($this->container['match_official_registrations'] === null) {
            return false;
        }
        if ($this->container['team_official_registrations'] === null) {
            return false;
        }
        if ($this->container['organisation_official_registrations'] === null) {
            return false;
        }
        return true;
    }

    /**
     * Gets player_registrations
     * @return \Fifa\ConnectId\Sdk\Api\Model\PlayerRegistrationType[]
     */
    public function getPlayerRegistrations()
    {
        return $this->container['player_registrations'];
    }

    /**
     * Sets player_registrations
     * @param \Fifa\ConnectId\Sdk\Api\Model\PlayerRegistrationType[] $player_registrations
     * @return $this
     */
    public function setPlayerRegistrations($player_registrations)
    {
        $this->container['player_registrations'] = $player_registrations;

        return $this;
    }

    /**
     * Gets match_official_registrations
     * @return \Fifa\ConnectId\Sdk\Api\Model\MatchOfficialRegistrationType[]
     */
    public function getMatchOfficialRegistrations()
    {
        return $this->container['match_official_registrations'];
    }

    /**
     * Sets match_official_registrations
     * @param \Fifa\ConnectId\Sdk\Api\Model\MatchOfficialRegistrationType[] $match_official_registrations
     * @return $this
     */
    public function setMatchOfficialRegistrations($match_official_registrations)
    {
        $this->container['match_official_registrations'] = $match_official_registrations;

        return $this;
    }

    /**
     * Gets team_official_registrations
     * @return \Fifa\ConnectId\Sdk\Api\Model\TeamOfficialRegistrationType[]
     */
    public function getTeamOfficialRegistrations()
    {
        return $this->container['team_official_registrations'];
    }

    /**
     * Sets team_official_registrations
     * @param \Fifa\ConnectId\Sdk\Api\Model\TeamOfficialRegistrationType[] $team_official_registrations
     * @return $this
     */
    public function setTeamOfficialRegistrations($team_official_registrations)
    {
        $this->container['team_official_registrations'] = $team_official_registrations;

        return $this;
    }

    /**
     * Gets organisation_official_registrations
     * @return \Fifa\ConnectId\Sdk\Api\Model\OrganisationOfficialRegistrationType[]
     */
    public function getOrganisationOfficialRegistrations()
    {
        return $this->container['organisation_official_registrations'];
    }

    /**
     * Sets organisation_official_registrations
     * @param \Fifa\ConnectId\Sdk\Api\Model\OrganisationOfficialRegistrationType[] $organisation_official_registrations
     * @return $this
     */
    public function setOrganisationOfficialRegistrations($organisation_official_registrations)
    {
        $this->container['organisation_official_registrations'] = $organisation_official_registrations;

        return $this;
    }
    /**
     * Returns true if offset exists. False otherwise.
     * @param  integer $offset Offset
     * @return boolean
     */
    public function offsetExists($offset)
    {
        return isset($this->container[$offset]);
    }

    /**
     * Gets offset.
     * @param  integer $offset Offset
     * @return mixed
     */
    public function offsetGet($offset)
    {
        return isset($this->container[$offset]) ? $this->container[$offset] : null;
    }

    /**
     * Sets value based on offset.
     * @param  integer $offset Offset
     * @param  mixed   $value  Value to be set
     * @return void
     */
    public function offsetSet($offset, $value)
    {
        if (is_null($offset)) {
            $this->container[] = $value;
        } else {
            $this->container[$offset] = $value;
        }
    }

    /**
     * Unsets offset.
     * @param  integer $offset Offset
     * @return void
     */
    public function offsetUnset($offset)
    {
        unset($this->container[$offset]);
    }

    /**
     * Gets the string presentation of the object
     * @return string
     */
    public function __toString()
    {
        if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print
            return json_encode(\Fifa\ConnectId\Sdk\Api\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT);
        }

        return json_encode(\Fifa\ConnectId\Sdk\Api\ObjectSerializer::sanitizeForSerialization($this));
    }
}


