public function setUserId(int $id)
    {

        // Has the id changed?
        if ($id !== $this->userId) {
            // Invalidate existing user
            if ($this->user !== null && $this->user->getId() !== $id) {
                $this->user = null;
            };

            $this->userId = $id;
        }

        return $this;
    }
public function setUserId(int $id)
    {

        // Has the id changed?
        if ($id !== $this->userId) {
            // Invalidate existing user
            if ($this->user !== null && $this->user->getId() !== $id) {
                $this->user = null;
            };

            $this->userId = $id;
        }

        return $this;
    }
public function setUserId ( int $ id ) { // Has the id changed? if ( $ id !== $ this -> userId ) { // Invalidate existing user if ( $ this -> user !== null && $ this -> user -> getId ( ) !== $ id ) { $ this -> user = null ; } ; $ this -> userId = $ id ; } return $ this ; }
Set associated userId

@param $id
@return $this
Set associated userId