Skip to content

Instantly share code, notes, and snippets.

@merk
Created January 1, 2012 08:48
Show Gist options
  • Save merk/1546765 to your computer and use it in GitHub Desktop.
Save merk/1546765 to your computer and use it in GitHub Desktop.
Dough usage (until Doctrine 2.3's Value object support)
/**
* @param MoneyInterface $defaultIncrementalFee
*/
public function setDefaultIncrementalFee(MoneyInterface $defaultIncrementalFee)
{
$this->_defaultIncrementalFee = $defaultIncrementalFee;
$this->defaultIncrementalFee = $defaultIncrementalFee->reduce()->getAmount();
}
/**
* @return MoneyInterface
*/
public function getDefaultIncrementalFee()
{
if (null === $this->_defaultIncrementalFee && null !== $this->defaultIncrementalFee) {
$this->_defaultIncrementalFee = new Money($this->defaultIncrementalFee);
}
return $this->_defaultIncrementalFee;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment