setId( $data['id'] ?? null ); $entity->setInvoiceFileId( $data['invoice_file_id'] ); $entity->setMrn( $data['mrn'] ); $entity->setEadFileId( $data['ead_file_id'] ); return $entity; } /** * Creates item from standardized structure. * * @param array $data Data. * @return Entity\CustomsDeclarationItem */ public function createItemFromStandardizedStructure( array $data ): Entity\CustomsDeclarationItem { $entity = new Entity\CustomsDeclarationItem( $data['customs_declaration_id'], $data['customs_code'], (float) $data['value'], $data['product_name_en'], (int) $data['units_count'], $data['country_of_origin'], (float) $data['weight'] ); $entity->setId( $data['id'] ?? null ); $entity->setProductName( $data['product_name'] ); $entity->setIsFoodOrBook( (bool) ( $data['is_food_or_book'] ?? false ) ); $entity->setIsVoc( (bool) ( $data['is_voc'] ?? false ) ); return $entity; } }