Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Reference/Embbeded column with nullable=true couldn't be set to null by setMethod #288

Closed
kusmierz opened this Issue · 0 comments

2 participants

@kusmierz

I think for sth like

/**
 * 
 * @MongoDB\ReferenceOne(targetDocument="Sth", nullable=true)
 */
protected $test;

should produce

public function setTest(Sth $test = null)
    {
        $this->test = $test;
    }

instead of

public function setTest(Sth $test)
    {
        $this->test = $test;
    }

According to documentation (http://php.net/manual/en/language.oop5.typehinting.php) this is the only way for accepting "null" as parameter when type hinting. Of course if there is "nullable=false" generator could create method as now.

@ebuildy ebuildy referenced this issue from a commit
@ebuildy ebuildy Fix #288 nullable option not working for reference
Reference/Embbeded column with nullable=true couldn't be set to null by setMethod
1702318
@malarzm malarzm added the has PR label
@malarzm malarzm added this to the 1.0.0-BETA13 milestone
@malarzm malarzm closed this issue from a commit
@ebuildy ebuildy Fix #288 nullable option not working for reference
Reference/Embbeded column with nullable=true couldn't be set to null by setMethod
70817f4
@malarzm malarzm closed this in 70817f4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.