title: Catchable Fatal Error: Argument 1 passed to ... must be an instance of ..., array given
body: <p>I want to register a user. In my database I have a table <code>user</code> with a FK <code>player_id</code> and in my players table I have a FK <code>team_id</code> from my team table. </p>
  
  <p>This is my RegisterType Form:</p>
  
  <pre><code>class RegisterType extends AbstractType
  {
      /**
       * @param FormBuilderInterface $builder
       * @param array $options
       */
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder
              -&gt;add('userFirstname', 'text', [
                  'label' =&gt; 'Given name*',
                  'attr'  =&gt; [
                      'placeholder' =&gt; 'Enter your given name.',
                  ],
              ])
              -&gt;add('userSurname', 'text', [
                  'label' =&gt; 'Family name*',
                  'attr'  =&gt; ['placeholder' =&gt; 'Enter your family name.'],
              ])
              -&gt;add('userType', 'choice', array(
                  'choices' =&gt; array('E' =&gt; 'ENTHOUSIAST', 'P' =&gt; 'PLAYER', 'T' =&gt; 'TRAINER'),
                  'label'   =&gt; 'User Type*',
                  'attr' =&gt; array('placeholder' =&gt; 'User Type')
              ))
              -&gt;add('player', new PlayerType())
              -&gt;add('userUsername', 'text', [
                  'label' =&gt; 'Username*',
                  'attr'  =&gt; ['placeholder' =&gt; 'Enter a username.'],
              ])
              -&gt;add('userEmail', 'email', [
                  'label' =&gt; 'Email address*',
                  'attr'  =&gt; ['placeholder' =&gt; 'Enter your email address.'],
              ])
              -&gt;add('userPassword', 'repeated', [
                  'type'           =&gt; 'password',
                  'first_name'     =&gt; 'password',
                  'first_options'  =&gt; [
                      'label' =&gt; 'Password*',
                      'attr'  =&gt; ['placeholder' =&gt; 'Enter a password.'],
                  ],
                  'second_name'    =&gt; 'confirm',
                  'second_options' =&gt; [
                      'label' =&gt; 'Password (repeat)*',
                      'attr'  =&gt; ['placeholder' =&gt; 'Repeat the password.'],
                  ],
                  'invalid_message' =&gt; 'The passwords are not identical.',
              ])
              -&gt;add('btn_register', 'submit', [
                  'label' =&gt; 'Register',
              ])
          ;
      }
  
      /**
       * @return string
       */
      public function getName()
      {
          return 'register';
      }
  }
  </code></pre>
  
  <p>As you can see I've added a link to another form 'PlayerType'. This is my PlayerType Form:</p>
  
  <pre><code>class PlayerType extends AbstractType
  {
      /**
       * @param FormBuilderInterface $builder
       * @param array $options
       */
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder
              -&gt;add('playerLicensenumber', 'text', [
                  'label' =&gt; 'Your License number*',
                  'attr'  =&gt; ['placeholder' =&gt; 'Enter your license number.'],
              ])
              -&gt;add('playerPosition', 'choice', array(
                  'choices' =&gt; array('T' =&gt; 'Trainer', 'S' =&gt; 'Spelverdeler', 'R' =&gt; 'Receptie/Hoek', 'L' =&gt; 'Libero', 'M' =&gt; 'Midden', 'O' =&gt; 'Opposite', 'A' =&gt; 'All-round'),
                  'label'         =&gt; 'Position you play at*',
                  'attr' =&gt; array('placeholder' =&gt; 'Enter your play position.')
              ))
              -&gt;add('playerBirthyear', 'text', array(
                  'label' =&gt; 'Your Birth Year',
                  'attr'  =&gt; ['placeholder' =&gt; 'Enter your birth year.'],
                  'required' =&gt; false
              ))
              -&gt;add('team', 'text', array(
                  'label' =&gt; 'You play with*',
                  'attr'  =&gt; ['placeholder' =&gt; 'Enter your team.']
              ))
          ;
      }
  
      /**
       * @return string
       */
      public function getName()
      {
          return 'player';
      }
  }
  </code></pre>
  
  <p>And in my register.html.twig view I have all my user fields an my player fields like this:</p>
  
  <pre><code>&lt;div class="form-group{{ registerForm.player.playerLicensenumber.vars.valid ? '' : class_error }}"&gt;
      {{ form_label(registerForm.player.playerLicensenumber, label|default(),
      { "label_attr": { "class": "col-sm-3 control-label"}}) }}
      &lt;div class="col-sm-9"&gt;
          {{ form_widget(registerForm.player.playerLicensenumber,
          {"attr": {"class": "form-control"} }) }}
      &lt;/div&gt;
      {% if not registerForm.player.playerLicensenumber.vars.valid %}
          &lt;div class="col-sm-offset-3 col-sm-9 has-error"&gt;
              &lt;h5&gt;&lt;i class="glyphicon glyphicon-warning-sign"&gt;&lt;/i&gt; &lt;strong&gt;Please fix:&lt;/strong&gt;&lt;/h5&gt;
              {{ form_errors(registerForm.player.playerLicensenumber) }}
          &lt;/div&gt;
      {% endif %}
  &lt;/div&gt;
  &lt;div class="form-group{{ registerForm.player.playerBirthyear.vars.valid ? '' : class_error }}"&gt;
      {{ form_label(registerForm.player.playerBirthyear, label|default(),
      { "label_attr": { "class": "col-sm-3 control-label"}}) }}
      &lt;div class="col-sm-9"&gt;
          {{ form_widget(registerForm.player.playerBirthyear,
          {"attr": {"class": "form-control"} }) }}
      &lt;/div&gt;
      {% if not registerForm.player.playerBirthyear.vars.valid %}
          &lt;div class="col-sm-offset-3 col-sm-9 has-error"&gt;
              &lt;h5&gt;&lt;i class="glyphicon glyphicon-warning-sign"&gt;&lt;/i&gt; &lt;strong&gt;Please fix:&lt;/strong&gt;&lt;/h5&gt;
              {{ form_errors(registerForm.player.playerBirthyear) }}
          &lt;/div&gt;
      {% endif %}
  &lt;/div&gt;
  &lt;div class="form-group{{ registerForm.player.playerPosition.vars.valid ? '' : class_error }}"&gt;
      {{ form_label(registerForm.player.playerPosition, label|default(),
      { "label_attr": { "class": "col-sm-3 control-label"}}) }}
      &lt;div class="col-sm-9"&gt;
          {{ form_widget(registerForm.player.playerPosition,
          {"attr": {"class": "form-control"} }) }}
      &lt;/div&gt;
      {% if not registerForm.player.playerPosition.vars.valid %}
          &lt;div class="col-sm-offset-3 col-sm-9 has-error"&gt;
              &lt;h5&gt;&lt;i class="glyphicon glyphicon-warning-sign"&gt;&lt;/i&gt; &lt;strong&gt;Please fix:&lt;/strong&gt;&lt;/h5&gt;
              {{ form_errors(registerForm.player.playerPosition) }}
          &lt;/div&gt;
      {% endif %}
  &lt;/div&gt;
  &lt;div class="form-group{{ registerForm.player.team.vars.valid ? '' : class_error }}"&gt;
      {{ form_label(registerForm.player.team, label|default(),
      { "label_attr": { "class": "col-sm-3 control-label"}}) }}
      &lt;div class="col-sm-9"&gt;
          {{ form_widget(registerForm.player.team,
          {"attr": {"class": "form-control"} }) }}
      &lt;/div&gt;
      {% if not registerForm.player.team.vars.valid %}
          &lt;div class="col-sm-offset-3 col-sm-9 has-error"&gt;
              &lt;h5&gt;&lt;i class="glyphicon glyphicon-warning-sign"&gt;&lt;/i&gt; &lt;strong&gt;Please fix:&lt;/strong&gt;&lt;/h5&gt;
              {{ form_errors(registerForm.player.team) }}
          &lt;/div&gt;
      {% endif %}
  &lt;/div&gt;
  </code></pre>
  
  <p>This is my Users Entity Class:</p>
  
  <pre><code>class Users
  {
      /**
       * @var string
       *
       * @ORM\Column(name="user_username", type="string", length=45, nullable=false)
       */
      private $userUsername;
  
      /**
       * @var string
       *
       * @ORM\Column(name="user_firstname", type="string", length=45, nullable=false)
       */
      private $userFirstname;
  
      /**
       * @var string
       *
       * @ORM\Column(name="user_surname", type="string", length=255, nullable=false)
       */
      private $userSurname;
  
      /**
       * @var string
       *
       * @ORM\Column(name="user_email", type="string", length=255, nullable=false)
       */
      private $userEmail;
  
      /**
       * @var string
       *
       * @ORM\Column(name="user_type", type="string", nullable=false)
       */
      private $userType;
  
      /**
       * @var string
       *
       * @ORM\Column(name="user_password", type="string", length=60, nullable=false)
       */
      private $userPassword;
  
      /**
       * @var string
       *
       * @ORM\Column(name="user_salt", type="string", length=30, nullable=false)
       */
      private $userSalt;
  
      /**
       * @var string
       *
       * @ORM\Column(name="user_token", type="string", length=45, nullable=true)
       */
      private $userToken;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="user_created", type="datetime", nullable=false)
       */
      private $userCreated;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="user_modified", type="datetime", nullable=true)
       */
      private $userModified;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="user_deleted", type="datetime", nullable=true)
       */
      private $userDeleted;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="user_lastlogin", type="datetime", nullable=true)
       */
      private $userLastlogin;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="user_confirmed", type="datetime", nullable=true)
       */
      private $userConfirmed;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="user_locked", type="datetime", nullable=true)
       */
      private $userLocked;
  
      /**
       * @var integer
       *
       * @ORM\Column(name="user_id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="IDENTITY")
       */
      private $userId;
  
      /**
       * @var \VolleyScout\VolleyScoutBundle\Entity\Roles
       *
       * @ORM\ManyToOne(targetEntity="VolleyScout\VolleyScoutBundle\Entity\Roles")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="role_id", referencedColumnName="role_id")
       * })
       */
      private $role;
  
      /**
       * @var \Doctrine\Common\Collections\Collection
       *
       * @ORM\ManyToMany(targetEntity="VolleyScout\VolleyScoutBundle\Entity\Teams", inversedBy="user")
       * @ORM\JoinTable(name="user_follows_teams",
       *   joinColumns={
       *     @ORM\JoinColumn(name="user_id", referencedColumnName="user_id")
       *   },
       *   inverseJoinColumns={
       *     @ORM\JoinColumn(name="team_id", referencedColumnName="team_id")
       *   }
       * )
       */
      private $team;
  
      /**
       * @var \Doctrine\Common\Collections\Collection
       *
       * @ORM\ManyToMany(targetEntity="VolleyScout\VolleyScoutBundle\Entity\Competitions", inversedBy="user")
       * @ORM\JoinTable(name="user_follows_competitions",
       *   joinColumns={
       *     @ORM\JoinColumn(name="user_id", referencedColumnName="user_id")
       *   },
       *   inverseJoinColumns={
       *     @ORM\JoinColumn(name="competition_id", referencedColumnName="competition_id")
       *   }
       * )
       */
      private $competition;
  
      /**
       * Constructor
       */
      public function __construct()
      {
          $this-&gt;team = new \Doctrine\Common\Collections\ArrayCollection();
          $this-&gt;competition = new \Doctrine\Common\Collections\ArrayCollection();
      }
  
  
      /**
       * Set userUsername
       *
       * @param string $userUsername
       * @return Users
       */
      public function setUserUsername($userUsername)
      {
          $this-&gt;userUsername = $userUsername;
  
          return $this;
      }
  
      /**
       * Get userUsername
       *
       * @return string 
       */
      public function getUserUsername()
      {
          return $this-&gt;userUsername;
      }
  
      /**
       * Set userFirstname
       *
       * @param string $userFirstname
       * @return Users
       */
      public function setUserFirstname($userFirstname)
      {
          $this-&gt;userFirstname = $userFirstname;
  
          return $this;
      }
  
      /**
       * Get userFirstname
       *
       * @return string 
       */
      public function getUserFirstname()
      {
          return $this-&gt;userFirstname;
      }
  
      /**
       * Set userSurname
       *
       * @param string $userSurname
       * @return Users
       */
      public function setUserSurname($userSurname)
      {
          $this-&gt;userSurname = $userSurname;
  
          return $this;
      }
  
      /**
       * Get userSurname
       *
       * @return string 
       */
      public function getUserSurname()
      {
          return $this-&gt;userSurname;
      }
  
      /**
       * Set userEmail
       *
       * @param string $userEmail
       * @return Users
       */
      public function setUserEmail($userEmail)
      {
          $this-&gt;userEmail = $userEmail;
  
          return $this;
      }
  
      /**
       * Get userEmail
       *
       * @return string 
       */
      public function getUserEmail()
      {
          return $this-&gt;userEmail;
      }
  
      /**
       * Set userType
       *
       * @param string $userType
       * @return Users
       */
      public function setUserType($userType)
      {
          $this-&gt;userType = $userType;
  
          return $this;
      }
  
      /**
       * Get userType
       *
       * @return string 
       */
      public function getUserType()
      {
          return $this-&gt;userType;
      }
  
      /**
       * Set userPassword
       *
       * @param string $userPassword
       * @return Users
       */
      public function setUserPassword($userPassword)
      {
          $this-&gt;userPassword = $userPassword;
  
          return $this;
      }
  
      /**
       * Get userPassword
       *
       * @return string 
       */
      public function getUserPassword()
      {
          return $this-&gt;userPassword;
      }
  
      /**
       * Set userSalt
       *
       * @param string $userSalt
       * @return Users
       */
      public function setUserSalt($userSalt)
      {
          $this-&gt;userSalt = $userSalt;
  
          return $this;
      }
  
      /**
       * Get userSalt
       *
       * @return string 
       */
      public function getUserSalt()
      {
          return $this-&gt;userSalt;
      }
  
      /**
       * Set userToken
       *
       * @param string $userToken
       * @return Users
       */
      public function setUserToken($userToken)
      {
          $this-&gt;userToken = $userToken;
  
          return $this;
      }
  
      /**
       * Get userToken
       *
       * @return string 
       */
      public function getUserToken()
      {
          return $this-&gt;userToken;
      }
  
      /**
       * Set userCreated
       *
       * @param \DateTime $userCreated
       * @return Users
       */
      public function setUserCreated($userCreated)
      {
          $this-&gt;userCreated = $userCreated;
  
          return $this;
      }
  
      /**
       * Get userCreated
       *
       * @return \DateTime 
       */
      public function getUserCreated()
      {
          return $this-&gt;userCreated;
      }
  
      /**
       * Set userModified
       *
       * @param \DateTime $userModified
       * @return Users
       */
      public function setUserModified($userModified)
      {
          $this-&gt;userModified = $userModified;
  
          return $this;
      }
  
      /**
       * Get userModified
       *
       * @return \DateTime 
       */
      public function getUserModified()
      {
          return $this-&gt;userModified;
      }
  
      /**
       * Set userDeleted
       *
       * @param \DateTime $userDeleted
       * @return Users
       */
      public function setUserDeleted($userDeleted)
      {
          $this-&gt;userDeleted = $userDeleted;
  
          return $this;
      }
  
      /**
       * Get userDeleted
       *
       * @return \DateTime 
       */
      public function getUserDeleted()
      {
          return $this-&gt;userDeleted;
      }
  
      /**
       * Set userLastlogin
       *
       * @param \DateTime $userLastlogin
       * @return Users
       */
      public function setUserLastlogin($userLastlogin)
      {
          $this-&gt;userLastlogin = $userLastlogin;
  
          return $this;
      }
  
      /**
       * Get userLastlogin
       *
       * @return \DateTime 
       */
      public function getUserLastlogin()
      {
          return $this-&gt;userLastlogin;
      }
  
      /**
       * Set userConfirmed
       *
       * @param \DateTime $userConfirmed
       * @return Users
       */
      public function setUserConfirmed($userConfirmed)
      {
          $this-&gt;userConfirmed = $userConfirmed;
  
          return $this;
      }
  
      /**
       * Get userConfirmed
       *
       * @return \DateTime 
       */
      public function getUserConfirmed()
      {
          return $this-&gt;userConfirmed;
      }
  
      /**
       * Set userLocked
       *
       * @param \DateTime $userLocked
       * @return Users
       */
      public function setUserLocked($userLocked)
      {
          $this-&gt;userLocked = $userLocked;
  
          return $this;
      }
  
      /**
       * Get userLocked
       *
       * @return \DateTime 
       */
      public function getUserLocked()
      {
          return $this-&gt;userLocked;
      }
  
      /**
       * Get userId
       *
       * @return integer 
       */
      public function getUserId()
      {
          return $this-&gt;userId;
      }
  
      /**
       * Set role
       *
       * @param \VolleyScout\VolleyScoutBundle\Entity\Roles $role
       * @return Users
       */
      public function setRole(\VolleyScout\VolleyScoutBundle\Entity\Roles $role = null)
      {
          $this-&gt;role = $role;
  
          return $this;
      }
  
      /**
       * Get role
       *
       * @return \VolleyScout\VolleyScoutBundle\Entity\Roles 
       */
      public function getRole()
      {
          return $this-&gt;role;
      }
  
      /**
       * Add team
       *
       * @param \VolleyScout\VolleyScoutBundle\Entity\Teams $team
       * @return Users
       */
      public function addTeam(\VolleyScout\VolleyScoutBundle\Entity\Teams $team)
      {
          $this-&gt;team[] = $team;
  
          return $this;
      }
  
      /**
       * Remove team
       *
       * @param \VolleyScout\VolleyScoutBundle\Entity\Teams $team
       */
      public function removeTeam(\VolleyScout\VolleyScoutBundle\Entity\Teams $team)
      {
          $this-&gt;team-&gt;removeElement($team);
      }
  
      /**
       * Get team
       *
       * @return \Doctrine\Common\Collections\Collection 
       */
      public function getTeam()
      {
          return $this-&gt;team;
      }
  
      /**
       * Add competition
       *
       * @param \VolleyScout\VolleyScoutBundle\Entity\Competitions $competition
       * @return Users
       */
      public function addCompetition(\VolleyScout\VolleyScoutBundle\Entity\Competitions $competition)
      {
          $this-&gt;competition[] = $competition;
  
          return $this;
      }
  
      /**
       * Remove competition
       *
       * @param \VolleyScout\VolleyScoutBundle\Entity\Competitions $competition
       */
      public function removeCompetition(\VolleyScout\VolleyScoutBundle\Entity\Competitions $competition)
      {
          $this-&gt;competition-&gt;removeElement($competition);
      }
  
      /**
       * Get competition
       *
       * @return \Doctrine\Common\Collections\Collection 
       */
      public function getCompetition()
      {
          return $this-&gt;competition;
      }
  
      private $player;
  
      /**
       * Get player
       *
       * @return \VolleyScout\VolleyScoutBundle\Entity\Players
       */
      public function getPlayer() {
          return $this-&gt;player;
      }
      /**
       * Set player
       *
       * @param \VolleyScout\VolleyScoutBundle\Entity\Players $player
       * @return Users
       */
      public function setPlayer(\VolleyScout\VolleyScoutBundle\Entity\Players $player){
          $this-&gt;player = $player;
      }
  }
  </code></pre>
  
  <p>And my Players Entity Class:</p>
  
  <pre><code>class Players
  {
      /**
       * @var string
       *
       * @ORM\Column(name="player_name", type="string", length=255, nullable=false)
       */
      private $playerName;
  
      /**
       * @var string
       *
       * @ORM\Column(name="player_licensenumber", type="string", length=45, nullable=false)
       */
      private $playerLicensenumber;
  
      /**
       * @var string
       *
       * @ORM\Column(name="player_position", type="string", nullable=false)
       */
      private $playerPosition;
  
      /**
       * @var \DateTime
       *
       * @ORM\Column(name="player_birthyear", type="datetime", nullable=true)
       */
      private $playerBirthyear;
  
      /**
       * @var integer
       *
       * @ORM\Column(name="player_id", type="integer")
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="IDENTITY")
       */
      private $playerId;
  
      /**
       * @var \VolleyScout\VolleyScoutBundle\Entity\Myteam
       *
       * @ORM\ManyToOne(targetEntity="VolleyScout\VolleyScoutBundle\Entity\Myteam")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="myteam_id", referencedColumnName="myteam_id")
       * })
       */
      private $myteam;
  
      /**
       * @var \VolleyScout\VolleyScoutBundle\Entity\Teams
       *
       * @ORM\ManyToOne(targetEntity="VolleyScout\VolleyScoutBundle\Entity\Teams")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="team_id", referencedColumnName="team_id")
       * })
       */
      private $team;
  
      /**
       * @var \VolleyScout\VolleyScoutBundle\Entity\Users
       *
       * @ORM\ManyToOne(targetEntity="VolleyScout\VolleyScoutBundle\Entity\Users")
       * @ORM\JoinColumns({
       *   @ORM\JoinColumn(name="user_id", referencedColumnName="user_id")
       * })
       */
      private $user;
  
  
  
      /**
       * Set playerName
       *
       * @param string $playerName
       * @return Players
       */
      public function setPlayerName($playerName)
      {
          $this-&gt;playerName = $playerName;
  
          return $this;
      }
  
      /**
       * Get playerName
       *
       * @return string 
       */
      public function getPlayerName()
      {
          return $this-&gt;playerName;
      }
  
      /**
       * Set playerLicensenumber
       *
       * @param string $playerLicensenumber
       * @return Players
       */
      public function setPlayerLicensenumber($playerLicensenumber)
      {
          $this-&gt;playerLicensenumber = $playerLicensenumber;
  
          return $this;
      }
  
      /**
       * Get playerLicensenumber
       *
       * @return string 
       */
      public function getPlayerLicensenumber()
      {
          return $this-&gt;playerLicensenumber;
      }
  
      /**
       * Set playerPosition
       *
       * @param string $playerPosition
       * @return Players
       */
      public function setPlayerPosition($playerPosition)
      {
          $this-&gt;playerPosition = $playerPosition;
  
          return $this;
      }
  
      /**
       * Get playerPosition
       *
       * @return string 
       */
      public function getPlayerPosition()
      {
          return $this-&gt;playerPosition;
      }
  
      /**
       * Set playerBirthyear
       *
       * @param \DateTime $playerBirthyear
       * @return Players
       */
      public function setPlayerBirthyear($playerBirthyear)
      {
          $this-&gt;playerBirthyear = $playerBirthyear;
  
          return $this;
      }
  
      /**
       * Get playerBirthyear
       *
       * @return \DateTime 
       */
      public function getPlayerBirthyear()
      {
          return $this-&gt;playerBirthyear;
      }
  
      /**
       * Get playerId
       *
       * @return integer 
       */
      public function getPlayerId()
      {
          return $this-&gt;playerId;
      }
  
      /**
       * Set myteam
       *
       * @param \VolleyScout\VolleyScoutBundle\Entity\Myteam $myteam
       * @return Players
       */
      public function setMyteam(\VolleyScout\VolleyScoutBundle\Entity\Myteam $myteam = null)
      {
          $this-&gt;myteam = $myteam;
  
          return $this;
      }
  
      /**
       * Get myteam
       *
       * @return \VolleyScout\VolleyScoutBundle\Entity\Myteam 
       */
      public function getMyteam()
      {
          return $this-&gt;myteam;
      }
  
      /**
       * Set team
       *
       * @param \VolleyScout\VolleyScoutBundle\Entity\Teams $team
       * @return Players
       */
      public function setTeam(\VolleyScout\VolleyScoutBundle\Entity\Teams $team = null)
      {
          $this-&gt;team = $team;
  
          return $this;
      }
  
      /**
       * Get team
       *
       * @return \VolleyScout\VolleyScoutBundle\Entity\Teams 
       */
      public function getTeam()
      {
          return $this-&gt;team;
      }
  
      /**
       * Set user
       *
       * @param \VolleyScout\VolleyScoutBundle\Entity\Users $user
       * @return Players
       */
      public function setUser(\VolleyScout\VolleyScoutBundle\Entity\Users $user = null)
      {
          $this-&gt;user = $user;
  
          return $this;
      }
  
      /**
       * Get user
       *
       * @return \VolleyScout\VolleyScoutBundle\Entity\Users 
       */
      public function getUser()
      {
          return $this-&gt;user;
      }
  }
  </code></pre>
  
  <p>My problem is now when I want to submit I get the following error:</p>
  
  <pre><code>ContextErrorException: Catchable Fatal Error: Argument 1 passed to VolleyScout\VolleyScoutBundle\Entity\Users::setPlayer() must be an instance of VolleyScout\VolleyScoutBundle\Entity\Players, array given, called in /Applications/mampstack-5.4.20-0/apache2/htdocs/volleyscout/vendor/symfony/symfony/src/Symfony/Component/PropertyAccess/PropertyAccessor.php on line 360 and defined in /Applications/mampstack-5.4.20-0/apache2/htdocs/volleyscout/src/VolleyScout/VolleyScoutBundle/Entity/Users.php line 609
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>The 609 rule is this:</p>
  
  <pre><code>public function setPlayer(\VolleyScout\VolleyScoutBundle\Entity\Players $player){
      $this-&gt;player = $player;
  }
  </code></pre>
  
  <p>Rule 359, 360 in PropertyAccessor.php</p>
  
  <pre><code>if ($reflClass-&gt;hasMethod($setter) &amp;&amp; $reflClass-&gt;getMethod($setter)-&gt;isPublic()) {
          $object-&gt;$setter($value);
  </code></pre>