public function typeMappings() { if ($this->masterProduct) { return $this->masterProduct->typeMappings(); } else { return json_decode($this->type_mappings_json, true); } }