XenForo
Administrative
- Thread starter
- Admin
- #1
PHP:
This is not big problem, if we're not working with entities:
PHP:
Read more
ادامه مطلب...
Code:
$input = 999.00;
$type = \XF\Mvc\Entity\Entity::FLOAT;
$output = \XF::em()->getValueFormatter()->castValueToType($input, $type, []);
var_dump($input); // float(999)
var_dump($output); // int(999)
This is not big problem, if we're not working with entities:
PHP:
Code:
$item = \XF::em()->create('Something:Item'); // cost_amount - FLOAT, cost_currency - STR
$item->cost_amount = 999.00;
$item->cost_currency = 'RUR';
$item->save();
if ($item->isChanged('cost_amount') ||...
Read more
ادامه مطلب...