protected function _getAttribute($attribute_name) { switch ($attribute_name) { case 'weight': return (double) parent::_getAttribute($attribute_name); default: return parent::_getAttribute($attribute_name); } }