silverstripe-framework/tests/php/ORM/DBCompositeTest/DBDoubleMoney.php
2024-08-28 10:54:31 +12:00

18 lines
420 B
PHP

<?php
namespace SilverStripe\ORM\Tests\DBCompositeTest;
use SilverStripe\Dev\TestOnly;
use SilverStripe\ORM\FieldType\DBMoney;
class DBDoubleMoney extends DBMoney implements TestOnly
{
public function writeToManipulation(array &$manipulation): void
{
// Duplicate the amount before writing
$this->setAmount($this->getAmount() * 2);
parent::writeToManipulation($manipulation);
}
}