[Flow] Reset model value for reference (set to null)

Carsten Bleicker carsten at bleicker.de
Sun May 12 08:34:39 CEST 2013


just an idea:

/**
* @var \AFSVN\Basic\Domain\Model\Position
* @Flow\ManyToOne
* @ORM\Columns(nullable=true)
*/
protected $position;

/**
* @param \AFSVN\Basic\Domain\Model\Position $position
* @return void
*/
setPosition(\AFSVN\Basic\Domain\Model\Position $position = null){}


run ./flow doctrine:update to build the nullable column.


hope it helps!
hit me if not :)


Am 12.05.2013 um 02:33 schrieb Steffen Wickham:

> Hi guys,
> 
> I know that this question had been already asked a long while ago, but
> honestly I can't find it in my mailinglist archive.
> 
> I've got a ManyToOne relation in my model "RefereeAssignment" which
> refers to my model "Position". Under some circumstances a position
> reference has to be reset within RefereeAssignment. I'd tried to pass
> "NULL" to the repository but it crashes as expected with the following
> error:
> "Catchable Fatal Error: Argument 1 passed to
> AFSVN\Basic\Domain\Model\RefereeAssignment_Original::setPosition() must
> be an instance of AFSVN\Basic\Domain\Model\Position, null given, called
> in /[...]/AFSVN_Basic_Controller_MatchController.php on line 462 and
> defined in /[...]/AFSVN_Basic_Domain_Model_RefereeAssignment.php line 77"
> 
> Does anybody remember how this could be archived or know how to solve it?
> 
> Cheers,
> Steffen
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow



More information about the Flow mailing list