public function offsetSet($offset, $value) { if ('cost' === $offset) { $offset = 'total'; } parent::offsetSet($offset, $value); }