{"modulePath":"github.com/weiwolves/pkg","version":"v0.0.0-20200322065615-581c8d33cff6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package codegen\n\nPackage codegen is deprecated and generates Go code and is only used in development.\n\n### Configuration {#hdr-Configuration}\n\nIf you would like to configure the generation process because of custom EAV and attribute models please create a new file in this folder called \\`config\\_\\*.go\\` where \\`\\*\\` can be any name. @todo rethink that process and provide a better solution.\n\nYou must then use the \\`init()\\` function to append new values or change existing values of the configuration variables.\n\nAll defined variables in the file \\`config.go\\` can be changed. File is documented.\n\nWhy the init() function? [https://golang.org/doc/effective\\_go.html#initialization](https://golang.org/doc/effective_go.html#initialization)\n\nTODO(CS) Use [https://github.com/AOEpeople/MageTestStand](https://github.com/AOEpeople/MageTestStand) for TravisCI TODO(CS): Generate also JSONSchema [https://github.com/xeipuuv/gojsonschema](https://github.com/xeipuuv/gojsonschema) along with the Table\\* types\n\n## Constants\n\n```go\nconst (\n\tTableNameSeparator string = \"_\"\n\tTableEavEntityType string = \"eav_entity_type\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\t// TableEntityTypeSuffix e.g. for catalog_product_entity, customer_entity\n\tTableEntityTypeSuffix = \"entity\"\n\t// TableEntityTypeValueSuffixes defines all possible value type tables which an EAV model can have.\n\tTableEntityTypeValueSuffixes = ValueSuffixes{\n\t\t\"datetime\",\n\t\t\"decimal\",\n\t\t\"int\",\n\t\t\"text\",\n\t\t\"varchar\",\n\t}\n)\n```\n\n```go\nvar BasePath = NewOFile(build.Default.GOPATH, \"github.com/weiwolves/pkg\")\n```\nBasePath now a hack but should also consider if it has been vendored.\n\n```go\nvar ConfigAttributeModel = AttributeModelDefMap{\n\t\"catalog/product_attribute_frontend_image\":                                        NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductFrontendImage().Config(eav.AttributeFrontendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Frontend\\\\Image\":                    NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductFrontendImage().Config(eav.AttributeFrontendIdx({{.AttributeIndex}}))\"),\n\t\"eav/entity_attribute_frontend_datetime\":                                          NewAMD(\"github.com/weiwolves/pkg/eav.AttributeFrontendDatetime().Config(eav.AttributeFrontendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Eav\\\\Model\\\\Entity\\\\Attribute\\\\Frontend\\\\Datetime\":                      NewAMD(\"github.com/weiwolves/pkg/eav.AttributeFrontendDatetime().Config(eav.AttributeFrontendIdx({{.AttributeIndex}}))\"),\n\t\"catalog/attribute_backend_customlayoutupdate\":                                    NewAMD(\"\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Attribute\\\\Backend\\\\Customlayoutupdate\":                 NewAMD(\"\"),\n\t\"catalog/category_attribute_backend_image\":                                        NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.CategoryBackendImage().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Category\\\\Attribute\\\\Backend\\\\Image\":                    NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.CategoryBackendImage().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"catalog/category_attribute_backend_sortby\":                                       NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.CategoryBackendSortby().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Category\\\\Attribute\\\\Backend\\\\Sortby\":                   NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.CategoryBackendSortby().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"catalog/category_attribute_backend_urlkey\":                                       NewAMD(\"\"),\n\t\"catalog/product_attribute_backend_boolean\":                                       NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendBoolean().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Backend\\\\Boolean\":                   NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendBoolean().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Backend\\\\Category\":                  NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendCategory().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"catalog/product_attribute_backend_groupprice\":                                    NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendGroupPrice().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Backend\\\\GroupPrice\":                NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendGroupPrice().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"catalog/product_attribute_backend_media\":                                         NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendMedia().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Backend\\\\Media\":                     NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendMedia().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"catalog/product_attribute_backend_msrp\":                                          NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendPrice().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"catalog/product_attribute_backend_price\":                                         NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendPrice().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Backend\\\\Price\":                     NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendPrice().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"catalog/product_attribute_backend_recurring\":                                     NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendRecurring().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Backend\\\\Recurring\":                 NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendRecurring().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"catalog/product_attribute_backend_sku\":                                           NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendSku().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Backend\\\\Sku\":                       NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendSku().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"catalog/product_attribute_backend_startdate\":                                     NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendStartDate().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Backend\\\\Startdate\":                 NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendStartDate().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Backend\\\\Stock\":                     NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendStock().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"catalog/product_attribute_backend_tierprice\":                                     NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendTierPrice().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Backend\\\\Tierprice\":                 NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendTierPrice().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Backend\\\\Weight\":                    NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductBackendWeight().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"catalog/product_attribute_backend_urlkey\":                                        NewAMD(\"\"),\n\t\"customer/attribute_backend_data_boolean\":                                         NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerBackendDataBoolean().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Customer\\\\Model\\\\Attribute\\\\Backend\\\\Data\\\\Boolean\":                     NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerBackendDataBoolean().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"customer/customer_attribute_backend_billing\":                                     NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerBackendBilling().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Customer\\\\Model\\\\Customer\\\\Attribute\\\\Backend\\\\Billing\":                 NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerBackendBilling().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"customer/customer_attribute_backend_password\":                                    NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerBackendPassword().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Customer\\\\Model\\\\Customer\\\\Attribute\\\\Backend\\\\Password\":                NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerBackendPassword().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"customer/customer_attribute_backend_shipping\":                                    NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerBackendShipping().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Customer\\\\Model\\\\Customer\\\\Attribute\\\\Backend\\\\Shipping\":                NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerBackendShipping().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"customer/customer_attribute_backend_store\":                                       NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerBackendStore().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Customer\\\\Model\\\\Customer\\\\Attribute\\\\Backend\\\\Store\":                   NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerBackendStore().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"customer/customer_attribute_backend_website\":                                     NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerBackendWebsite().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Customer\\\\Model\\\\Customer\\\\Attribute\\\\Backend\\\\Website\":                 NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerBackendWebsite().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"customer/entity_address_attribute_backend_region\":                                NewAMD(\"github.com/weiwolves/pkg/customer/custattr.AddressBackendRegion().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Customer\\\\Model\\\\Resource\\\\Address\\\\Attribute\\\\Backend\\\\Region\":         NewAMD(\"github.com/weiwolves/pkg/customer/custattr.AddressBackendRegion().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"customer/entity_address_attribute_backend_street\":                                NewAMD(\"github.com/weiwolves/pkg/customer/custattr.AddressBackendStreet().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Eav\\\\Model\\\\Entity\\\\Attribute\\\\Backend\\\\DefaultBackend\":                 NewAMD(\"github.com/weiwolves/pkg/eav.AttributeBackendDefaultBackend().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"eav/entity_attribute_backend_datetime\":                                           NewAMD(\"github.com/weiwolves/pkg/eav.AttributeBackendDatetime().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Eav\\\\Model\\\\Entity\\\\Attribute\\\\Backend\\\\Datetime\":                       NewAMD(\"github.com/weiwolves/pkg/eav.AttributeBackendDatetime().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"eav/entity_attribute_backend_time_created\":                                       NewAMD(\"github.com/weiwolves/pkg/eav.AttributeBackendTimeCreated().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Eav\\\\Model\\\\Entity\\\\Attribute\\\\Backend\\\\Time\\\\Created\":                  NewAMD(\"github.com/weiwolves/pkg/eav.AttributeBackendTimeCreated().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"eav/entity_attribute_backend_time_updated\":                                       NewAMD(\"github.com/weiwolves/pkg/eav.AttributeBackendTimeUpdated().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Eav\\\\Model\\\\Entity\\\\Attribute\\\\Backend\\\\Time\\\\Updated\":                  NewAMD(\"github.com/weiwolves/pkg/eav.AttributeBackendTimeUpdated().Config(eav.AttributeBackendIdx({{.AttributeIndex}}))\"),\n\t\"bundle/product_attribute_source_price_view\":                                      NewAMD(\"github.com/weiwolves/pkg/bundle.AttributeSourcePriceView().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Bundle\\\\Model\\\\Product\\\\Attribute\\\\Source\\\\Price\\\\View\":                 NewAMD(\"github.com/weiwolves/pkg/bundle.AttributeSourcePriceView().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\CatalogInventory\\\\Model\\\\Source\\\\Stock\":                                 NewAMD(\"github.com/weiwolves/pkg/cataloginventory.AttributeSourceStock().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"catalog/category_attribute_source_layout\":                                        NewAMD(\"\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Category\\\\Attribute\\\\Source\\\\Layout\":                    NewAMD(\"\"),\n\t\"catalog/category_attribute_source_mode\":                                          NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.CategorySourceMode().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Category\\\\Attribute\\\\Source\\\\Mode\":                      NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.CategorySourceMode().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"catalog/category_attribute_source_page\":                                          NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.CategorySourcePage().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Category\\\\Attribute\\\\Source\\\\Page\":                      NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.CategorySourcePage().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"catalog/category_attribute_source_sortby\":                                        NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.CategorySourceSortby().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Category\\\\Attribute\\\\Source\\\\Sortby\":                    NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.CategorySourceSortby().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"catalog/entity_product_attribute_design_options_container\":                       NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductSourceDesignOptionsContainer().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Entity\\\\Product\\\\Attribute\\\\Design\\\\Options\\\\Container\": NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductSourceDesignOptionsContainer().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"catalog/product_attribute_source_countryofmanufacture\":                           NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductSourceCountryOfManufacture().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Source\\\\Countryofmanufacture\":       NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductSourceCountryOfManufacture().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"catalog/product_attribute_source_layout\":                                         NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductSourceLayout().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Source\\\\Layout\":                     NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductSourceLayout().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Source\\\\Status\":                     NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductSourceStatus().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"catalog/product_attribute_source_msrp_type_enabled\":                              NewAMD(\"\"),\n\t\"catalog/product_attribute_source_msrp_type_price\":                                NewAMD(\"github.com/weiwolves/pkg/msrp.NewAttributeSourcePrice().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Msrp\\\\Model\\\\Product\\\\Attribute\\\\Source\\\\Type\\\\Price\":                   NewAMD(\"github.com/weiwolves/pkg/msrp.NewAttributeSourcePrice().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"catalog/product_status\":                                                          NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductSourceStatus().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"catalog/product_visibility\":                                                      NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductSourceVisibility().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Visibility\":                                    NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductSourceVisibility().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Catalog\\\\Model\\\\Product\\\\Attribute\\\\Source\\\\Visibility\":                 NewAMD(\"github.com/weiwolves/pkg/catalog/catattr.ProductSourceVisibility().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"core/design_source_design\":                                                       NewAMD(\"\"),\n\t\"customer/customer_attribute_source_group\":                                        NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerSourceGroup().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Customer\\\\Model\\\\Customer\\\\Attribute\\\\Source\\\\Group\":                    NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerSourceGroup().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"customer/customer_attribute_source_store\":                                        NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerSourceStore().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Customer\\\\Model\\\\Customer\\\\Attribute\\\\Source\\\\Store\":                    NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerSourceStore().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"customer/customer_attribute_source_website\":                                      NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerSourceWebsite().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Customer\\\\Model\\\\Customer\\\\Attribute\\\\Source\\\\Website\":                  NewAMD(\"github.com/weiwolves/pkg/customer/custattr.CustomerSourceWebsite().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"customer/entity_address_attribute_source_country\":                                NewAMD(\"github.com/weiwolves/pkg/customer/custattr.AddressSourceCountry().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Customer\\\\Model\\\\Resource\\\\Address\\\\Attribute\\\\Source\\\\Country\":         NewAMD(\"github.com/weiwolves/pkg/customer/custattr.AddressSourceCountry().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"customer/entity_address_attribute_source_region\":                                 NewAMD(\"github.com/weiwolves/pkg/customer/custattr.AddressSourceRegion().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Customer\\\\Model\\\\Resource\\\\Address\\\\Attribute\\\\Source\\\\Region\":          NewAMD(\"github.com/weiwolves/pkg/customer/custattr.AddressSourceRegion().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"eav/entity_attribute_source_boolean\":                                             NewAMD(\"github.com/weiwolves/pkg/eav.AttributeSourceBoolean().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Eav\\\\Model\\\\Entity\\\\Attribute\\\\Source\\\\Boolean\":                         NewAMD(\"github.com/weiwolves/pkg/eav.AttributeSourceBoolean().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"eav/entity_attribute_source_table\":                                               NewAMD(\"github.com/weiwolves/pkg/eav.AttributeSourceTable().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Eav\\\\Model\\\\Entity\\\\Attribute\\\\Source\\\\Table\":                           NewAMD(\"github.com/weiwolves/pkg/eav.AttributeSourceTable().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"tax/class_source_product\":                                                        NewAMD(\"github.com/weiwolves/pkg/tax.AttributeSourceTaxClassProduct().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Tax\\\\Model\\\\TaxClass\\\\Source\\\\Product\":                                  NewAMD(\"github.com/weiwolves/pkg/tax.AttributeSourceTaxClassProduct().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Tax\\\\Model\\\\TaxClass\\\\Source\\\\Customer\":                                 NewAMD(\"github.com/weiwolves/pkg/tax.AttributeSourceTaxClassCustomer().Config(eav.AttributeSourceIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Theme\\\\Model\\\\Theme\\\\Source\\\\Theme\":                                     NewAMD(\"\"),\n\t\"customer/attribute_data_postcode\":                                                NewAMD(\"github.com/weiwolves/pkg/customer/custattr.AddressDataPostcode().Config(eav.AttributeDataIdx({{.AttributeIndex}}))\"),\n\t\"Magento\\\\Customer\\\\Model\\\\Attribute\\\\Data\\\\Postcode\":                             NewAMD(\"github.com/weiwolves/pkg/customer/custattr.AddressDataPostcode().Config(eav.AttributeDataIdx({{.AttributeIndex}}))\"),\n}\n```\nConfigAttributeModel contains default configuration. Use the file config\\_user.go with the func init() to change/extend it.\n\n```go\nvar ConfigEntityType = EntityTypeMap{\n\t\"customer\": \u0026EntityType{\n\t\tEntityModel:                         \"github.com/weiwolves/pkg/customer.Customer()\",\n\t\tAttributeModel:                      \"github.com/weiwolves/pkg/customer/custattr.HandlerCustomer({{.EntityTypeID}})\",\n\t\tEntityTable:                         \"github.com/weiwolves/pkg/customer.Customer()\",\n\t\tIncrementModel:                      \"github.com/weiwolves/pkg/customer.Customer()\",\n\t\tAdditionalAttributeTable:            \"github.com/weiwolves/pkg/customer.Customer()\",\n\t\tEntityAttributeCollection:           \"github.com/weiwolves/pkg/customer/custattr.HandlerCustomer({{.EntityTypeID}})\",\n\t\tTempAdditionalAttributeTable:        \"{{tableprefix}}customer_eav_attribute\",\n\t\tTempAdditionalAttributeTableWebsite: \"{{tableprefix}}customer_eav_attribute_website\",\n\t\tAttributeCoreColumns:                customerAttributeCoreColumns,\n\t},\n\t\"customer_address\": \u0026EntityType{\n\t\tEntityModel:                         \"github.com/weiwolves/pkg/customer.Address()\",\n\t\tAttributeModel:                      \"github.com/weiwolves/pkg/customer/custattr.HandlerAddress({{.EntityTypeID}})\",\n\t\tEntityTable:                         \"github.com/weiwolves/pkg/customer.Address()\",\n\t\tAdditionalAttributeTable:            \"github.com/weiwolves/pkg/customer.Address()\",\n\t\tEntityAttributeCollection:           \"github.com/weiwolves/pkg/customer/custattr.HandlerAddress({{.EntityTypeID}})\",\n\t\tTempAdditionalAttributeTable:        \"{{tableprefix}}customer_eav_attribute\",\n\t\tTempAdditionalAttributeTableWebsite: \"{{tableprefix}}customer_eav_attribute_website\",\n\t\tAttributeCoreColumns:                customerAttributeCoreColumns,\n\t},\n\t\"catalog_category\": \u0026EntityType{\n\t\tEntityModel:                  \"github.com/weiwolves/pkg/catalog.Category()\",\n\t\tAttributeModel:               \"github.com/weiwolves/pkg/catalog/catattr.HandlerCategory({{.EntityTypeID}})\",\n\t\tEntityTable:                  \"github.com/weiwolves/pkg/catalog.Category()\",\n\t\tAdditionalAttributeTable:     \"github.com/weiwolves/pkg/catalog.Category()\",\n\t\tEntityAttributeCollection:    \"github.com/weiwolves/pkg/catalog/catattr.HandlerCategory({{.EntityTypeID}})\",\n\t\tTempAdditionalAttributeTable: \"{{tableprefix}}catalog_eav_attribute\",\n\t\tAttributeCoreColumns:         catalogAttributeCoreColumns,\n\t},\n\t\"catalog_product\": \u0026EntityType{\n\t\tEntityModel:                  \"github.com/weiwolves/pkg/catalog.Product()\",\n\t\tAttributeModel:               \"github.com/weiwolves/pkg/catalog/catattr.HandlerProduct({{.EntityTypeID}})\",\n\t\tEntityTable:                  \"github.com/weiwolves/pkg/catalog.Product()\",\n\t\tAdditionalAttributeTable:     \"github.com/weiwolves/pkg/catalog.Product()\",\n\t\tEntityAttributeCollection:    \"github.com/weiwolves/pkg/catalog/catattr.HandlerProduct({{.EntityTypeID}})\",\n\t\tTempAdditionalAttributeTable: \"{{tableprefix}}catalog_eav_attribute\",\n\t\tAttributeCoreColumns:         catalogAttributeCoreColumns,\n\t},\n}\n```\nConfigEntityType contains default configuration to materialize the entity types. Use the file config\\_user.go with the func init() to change/extend it. Needed in materializeEntityType()\n\n```go\nvar ConfigLocalization = struct {\n\tPackage       string\n\tOutputFile    string\n\tEnabledLocale slices.String\n}{\n\tPackage:       \"i18n_test\",\n\tOutputFile:    BasePath.AppendDir(\"i18n\", \"generated_translation_test\").String(),\n\tEnabledLocale: slices.String{\"en\", \"fr\", \"de\", \"de_CH\", \"nl\", \"ca_FR\"},\n}\n```\nConfigLocalization temporary integration because missing feature in [https://github.com/golang/text](https://github.com/golang/text)\n\n```go\nvar ConfigMaterializationAttributes = AttributeToStructMap{\n\t\"customer\": \u0026AttributeToStruct{\n\t\tAttrPkgImp:     \"github.com/weiwolves/pkg/customer/custattr\",\n\t\tFuncCollection: \"SetCustomerCollection\",\n\t\tFuncGetter:     \"SetCustomerGetter\",\n\t\tAttrStruct:     \"Customer\",\n\t\tMyStruct:       \"\",\n\t\tPackage:        \"testgen\",\n\t\tOutputFile:     BasePath.AppendDir(\"testgen\", \"generated_customer_attribute_test\").String(),\n\t},\n\t\"customer_address\": \u0026AttributeToStruct{\n\t\tAttrPkgImp:     \"github.com/weiwolves/pkg/customer/custattr\",\n\t\tFuncCollection: \"SetAddressCollection\",\n\t\tFuncGetter:     \"SetAddressGetter\",\n\t\tAttrStruct:     \"Customer\",\n\t\tMyStruct:       \"\",\n\t\tPackage:        \"testgen\",\n\t\tOutputFile:     BasePath.AppendDir(\"testgen\", \"generated_address_attribute_test\").String(),\n\t},\n\t\"catalog_product\": \u0026AttributeToStruct{\n\t\tAttrPkgImp:     \"github.com/weiwolves/pkg/catalog/catattr\",\n\t\tFuncCollection: \"SetProductCollection\",\n\t\tFuncGetter:     \"SetProductGetter\",\n\t\tAttrStruct:     \"Catalog\",\n\t\tMyStruct:       \"\",\n\t\tPackage:        \"testgen\",\n\t\tOutputFile:     BasePath.AppendDir(\"testgen\", \"generated_product_attribute_test.go\").String(),\n\t},\n\t\"catalog_category\": \u0026AttributeToStruct{\n\t\tAttrPkgImp:     \"github.com/weiwolves/pkg/catalog/catattr\",\n\t\tFuncCollection: \"SetCategoryCollection\",\n\t\tFuncGetter:     \"SetCategoryGetter\",\n\t\tAttrStruct:     \"Catalog\",\n\t\tMyStruct:       \"\",\n\t\tPackage:        \"testgen\",\n\t\tOutputFile:     BasePath.AppendDir(\"testgen\", \"generated_category_attribute_test.go\").String(),\n\t},\n}\n```\nConfigMaterializationAttributes contains the configuration to materialize all attributes for the defined EAV entity types.\n\n```go\nvar ConfigMaterializationEntityType = TableToStruct{\n\tPackage:    \"testgen\",\n\tOutputFile: BasePath.AppendDir(\"testgen\", \"generated_entity_type_test\"),\n}\n```\nConfigMaterializationEntityType configuration for materializeEntityType() to write the materialized entity types into a folder. Other fields of the struct TableToStruct are ignored. Use the file config\\_user.go with the func init() to change/extend it.\n\n```go\nvar ConfigTableToStruct = TableToStructMap{\n\t\"authorization\": TableToStruct{\n\t\tPackage:    \"authorization\",\n\t\tOutputFile: BasePath.AppendDir(\"authorization\", \"tables_generated\"),\n\t\tSQLQuery: `SELECT TABLE_NAME FROM information_schema.COLUMNS WHERE\n\t\t\t\t\t\tTABLE_SCHEMA = DATABASE() AND\n\t\t\t\t\t\tTABLE_NAME IN (\n\t\t\t\t\t\t\t'{{tableprefix}}authorization_role','{{tableprefix}}admin_role',\n\t\t\t\t\t\t\t'{{tableprefix}}authorization_rule','{{tableprefix}}admin_rule'\n\t\t\t\t\t\t) GROUP BY TABLE_NAME;`,\n\t\tEntityTypeCodes:   nil,\n\t\tGenericsWhiteList: \"SQLQuery\",\n\t\tGenericsFunctions: tpl.OptSQL | tpl.OptFindBy,\n\t},\n\t\"user\": TableToStruct{\n\t\tPackage:           \"user\",\n\t\tOutputFile:        BasePath.AppendDir(\"user\", \"tables_generated\"),\n\t\tSQLQuery:          `{{tableprefix}}admin_user`,\n\t\tEntityTypeCodes:   nil,\n\t\tGenericsWhiteList: \"SQLQuery\",\n\t\tGenericsFunctions: tpl.OptAll,\n\t},\n\t\"config/storage/ccd\": TableToStruct{\n\t\tPackage:           \"ccd\",\n\t\tOutputFile:        BasePath.AppendDir(\"config\", \"storage\", \"ccd\", \"tables_generated\"),\n\t\tSQLQuery:          `{{tableprefix}}core_config_data`,\n\t\tEntityTypeCodes:   nil,\n\t\tGenericsWhiteList: \"\",\n\t},\n\t\"directory\": TableToStruct{\n\t\tPackage:    \"directory\",\n\t\tOutputFile: BasePath.AppendDir(\"directory\", \"tables_generated\"),\n\t\tSQLQuery: `SELECT TABLE_NAME FROM information_schema.COLUMNS WHERE\n\t\t\t\t\t\tTABLE_SCHEMA = DATABASE() AND\n\t\t\t\t\t\tTABLE_NAME LIKE '{{tableprefix}}directory%' GROUP BY TABLE_NAME;`,\n\t\tEntityTypeCodes:   nil,\n\t\tGenericsWhiteList: \"SQLQuery\",\n\t\tGenericsFunctions: tpl.OptAll,\n\t},\n\t\"eav\": TableToStruct{\n\t\tPackage:         \"eav\",\n\t\tOutputFile:      BasePath.AppendDir(\"eav\", \"tables_generated\"),\n\t\tSQLQuery:        `{{tableprefix}}eav%`,\n\t\tEntityTypeCodes: nil,\n\t\tGenericsWhiteList: `SELECT TABLE_NAME FROM information_schema.COLUMNS WHERE\n\t\t\t\t\t\tTABLE_SCHEMA = DATABASE() AND\n\t\t\t\t\t\tTABLE_NAME LIKE '{{tableprefix}}eav_entity_type' GROUP BY TABLE_NAME;`,\n\t\tGenericsFunctions: tpl.OptSQL | tpl.OptFindBy,\n\t},\n\t\"store\": TableToStruct{\n\t\tPackage:    \"store\",\n\t\tOutputFile: BasePath.AppendDir(\"store\", \"tables_generated\"),\n\t\tSQLQuery: `SELECT TABLE_NAME FROM information_schema.COLUMNS WHERE\n\t\t\t\t\tTABLE_SCHEMA = DATABASE() AND\n\t\t\t\t\tTABLE_NAME IN (\n\t\t\t\t\t\t'{{tableprefix}}core_store','{{tableprefix}}store',\n\t\t\t\t\t\t'{{tableprefix}}core_store_group','{{tableprefix}}store_group',\n\t\t\t\t\t\t'{{tableprefix}}core_website','{{tableprefix}}store_website'\n\t\t\t\t\t) GROUP BY TABLE_NAME;`,\n\t\tEntityTypeCodes:   nil,\n\t\tGenericsWhiteList: \"SQLQuery\",\n\t\tGenericsFunctions: tpl.OptAll,\n\t},\n\t\"catalog\": TableToStruct{\n\n\t\tPackage:    \"catalog\",\n\t\tOutputFile: BasePath.AppendDir(\"catalog\", \"tables_generated\"),\n\t\tSQLQuery: `SELECT TABLE_NAME FROM information_schema.COLUMNS WHERE\n\t\t\t\t\t\tTABLE_SCHEMA = DATABASE() AND\n\t\t\t\t\t\t(TABLE_NAME LIKE '{{tableprefix}}catalog\\_%' OR TABLE_NAME LIKE '{{tableprefix}}catalogindex%' ) AND\n\t\t\t\t\t\tTABLE_NAME NOT LIKE '{{tableprefix}}%bundle%' AND\n\t\t\t\t\t\tTABLE_NAME NOT LIKE '{{tableprefix}}%\\_flat\\_%' GROUP BY TABLE_NAME;`,\n\t\tEntityTypeCodes: []string{\"catalog_category\", \"catalog_product\"},\n\t\tGenericsWhiteList: `SELECT TABLE_NAME FROM information_schema.COLUMNS WHERE\n\t\t\t\t\t\t\t\tTABLE_SCHEMA = DATABASE() AND\n\t\t\t\t\t\t\t\t(TABLE_NAME LIKE '{{tableprefix}}catalog\\_%' OR TABLE_NAME LIKE '{{tableprefix}}catalogindex%' ) AND\n\t\t\t\t\t\t\t\tTABLE_NAME NOT LIKE '{{tableprefix}}%bundle%' AND\n\t\t\t\t\t\t\t\tTABLE_NAME NOT LIKE '{{tableprefix}}%idx%' AND\n\t\t\t\t\t\t\t\tTABLE_NAME NOT LIKE '{{tableprefix}}%tmp%' AND\n\t\t\t\t\t\t\t\tTABLE_NAME NOT LIKE '{{tableprefix}}%\\_flat\\_%' GROUP BY TABLE_NAME;`,\n\t\tGenericsFunctions: tpl.OptAll,\n\t},\n\t\"customer\": TableToStruct{\n\t\tPackage:           \"customer\",\n\t\tOutputFile:        BasePath.AppendDir(\"customer\", \"tables_generated\"),\n\t\tSQLQuery:          `{{tableprefix}}customer%`,\n\t\tEntityTypeCodes:   []string{\"customer\", \"customer_address\"},\n\t\tGenericsWhiteList: \"SQLQuery\",\n\t\tGenericsFunctions: tpl.OptAll,\n\t},\n}\n```\nConfigTableToStruct contains default configuration. Use the file config\\_user.go with the func init() to change/extend it.\n\n```go\nvar (\n\tCopyright = []byte(`// Copyright 2015-2017, Cyrill @ Schumacher.fm and the CoreStore contributors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n`)\n)\n```\n\n```go\nvar (\n\t// EAVAttributeCoreColumns defines the minimal required columns for table\n\t// eav_attribute. Developers can extend the table eav_attribute with\n\t// additional columns but these additional columns with its method receivers\n\t// must get generated in the attribute materialize function. These core\n\t// columns are already defined below.\n\tEAVAttributeCoreColumns = slices.String{\n\t\t\"attribute_id\",\n\t\t\"entity_type_id\",\n\t\t\"attribute_code\",\n\t\t\"attribute_model\",\n\t\t\"backend_model\",\n\t\t\"backend_type\",\n\t\t\"backend_table\",\n\t\t\"frontend_model\",\n\t\t\"frontend_input\",\n\t\t\"frontend_label\",\n\t\t\"frontend_class\",\n\t\t\"source_model\",\n\t\t\"is_required\",\n\t\t\"is_user_defined\",\n\t\t\"default_value\",\n\t\t\"is_unique\",\n\t\t\"note\",\n\t}\n)\n```\n\n```go\nvar EavAttributeColumnNameToInterface = map[string]string{\n\t\"backend_model\":           \"eav.AttributeBackendModeller\",\n\t\"frontend_model\":          \"eav.AttributeFrontendModeller\",\n\t\"source_model\":            \"eav.AttributeSourceModeller\",\n\t\"frontend_input_renderer\": \"eav.FrontendInputRendererIFace\",\n\t\"data_model\":              \"eav.AttributeDataModeller\",\n}\n```\nEavAttributeColumnNameToInterface mapping column name to Go interface name. Do not add attribute\\_model as this column is unused in Magento 1+2. If you have custom column then add it here.\n\n```go\nvar TableMapMagento1To2 = map[string]string{\n\t\"admin_role\":             \"authorization_role\",\n\t\"admin_rule\":             \"authorization_rule\",\n\t\"core_cache\":             \"cache\",\n\t\"core_cache_tag\":         \"cache_tag\",\n\t\"core_config_data\":       \"core_config_data\",\n\t\"core_design_change\":     \"design_change\",\n\t\"core_directory_storage\": \"media_storage_directory_storage\",\n\t\"core_email_template\":    \"email_template\",\n\t\"core_file_storage\":      \"media_storage_file_storage\",\n\t\"core_flag\":              \"flag\",\n\t\"core_layout_link\":       \"layout_link\",\n\t\"core_layout_update\":     \"layout_update\",\n\t\"core_resource\":          \"setup_module\",\n\t\"core_session\":           \"session\",\n\t\"core_store\":             \"store\",\n\t\"core_store_group\":       \"store_group\",\n\t\"core_variable\":          \"variable\",\n\t\"core_variable_value\":    \"variable_value\",\n\t\"core_website\":           \"store_website\",\n}\n```\nTableMapMagento1To2 provides mapping between table names in tableToStruct. If a table name is in the map then the struct name will be rewritten to that new Magneto2 compatible table name. Do not change entries in this map except you can always append. @see Magento2 dev/tools/Magento/Tools/Migration/factory\\_table\\_names/replace\\_ce.php\n\n```go\nvar TablePrefix string\n```\nTablePrefix defines the global table name prefix. See Magento install tool. Can be overridden via func init()\n\n## Functions\n\n```go\nfunc ColumnsToStructCode(tplData map[string]interface{}, name string, cols Columns, templates ...string) ([]byte, error)\n```\nColumnsToStructCode generates Go code from a name and a slice of columns. Make sure that the fields GoType and GoName has been setup If you don't like the template you can provide your own template as 3rd to n-th argument.\n\n```go\nfunc ExtractFuncType(s string) (string, error)\n```\nExtractFuncType extracts from an extended import path with a function or type call the function or type call. github.com/weiwolves/pkg/customer.Customer() would become customer.Customer()\n\n```go\nfunc ExtractImportPath(s string) (string, error)\n```\nExtractImportPath extracts from an extended import path with a function or type call the import path. github.com/weiwolves/pkg/customer.Customer() would become github.com/weiwolves/pkg/customer\n\n```go\nfunc GenerateCode(pkg, tplCode string, data interface{}, addFM template.FuncMap) ([]byte, error)\n```\nGenerateCode uses text/template for create Go code. package name pkg will also be used to remove stutter in variable names.\n\n```go\nfunc LogFatal(err error)\n```\nLogFatal logs an error as fatal with printed location and terminates the program.\n\n```go\nfunc ParseString(tpl string, data interface{}) string\n```\nParseString text/template for a string. Fails on error.\n\n```go\nfunc PrepareForTemplate(cols Columns, rows []StringEntities, amm AttributeModelDefMap, targetPkg string) []string\n```\nPrepareForTemplate uses the Columns slice to transform the rows so that correct Go code can be printed. int/Float values won't be touched. Bools or IntBools will be converted to true/false. Strings will be quoted. And if there is an entry in the AttributeModelMap then the Go code from the map will be used. Returns a slice containing all the import paths. Import paths which are equal to pkg will be filtered out.\n\n```go\nfunc PrepareVar(pkg, s string) string\n```\nPrepareVar converts a string into a Go code variable. Removes the package name if this string starts with the package name. Replaces all illegal characters with an underscore.\n\n```go\nfunc ReplaceTablePrefix(query string) string\n```\nReplaceTablePrefix replaces the {{tableprefix}} place holder with the configure real TablePrefix TablePrefix can be set via init() statement in config\\_user.go\n\n## Types\n\n```go\ntype AddAttrTables struct {\n\tEntityTypeCode string\n\t// contains filtered or unexported fields\n}\n```\nDepends on generated code from tableToStruct.\n\n```go\nfunc NewAddAttrTables(db *sql.DB, code string) *AddAttrTables\n```\nImplements interface eav.EntityTypeAdditionalAttributeTabler\n\n```go\nfunc (aa *AddAttrTables) TableAdditionalAttribute() (*csdb.Table, error)\n```\nImplements interface eav.EntityTypeAdditionalAttributeTabler\n\n```go\nfunc (aa *AddAttrTables) TableEavWebsite() (*csdb.Table, error)\n```\nImplements interface eav.EntityTypeAdditionalAttributeTabler\n\n```go\ntype AttributeModelDef struct {\n\t// GoFunc is a function string which implements, when later executed,\n\t// one of the n interfaces for (backend|frontend|source|data)_model. The\n\t// GoFunc expects the fully qualified import path to the final method,\n\t// e.g.: github.com/weiwolves/pkg/customer.Customer()\n\tGoFunc string\n\t// contains filtered or unexported fields\n}\n```\nAttributeModelDef defines which Go type/func has which import path\n\n```go\nfunc NewAMD(GoFuncWithPath string) *AttributeModelDef\n```\nNewAMD NewAttributeModelDef NewAttributeModelDef creates a new attribute model definition\n\n```go\nfunc (d *AttributeModelDef) Func() string\n```\nFunc extracts the function\n\n```go\nfunc (d *AttributeModelDef) Import() string\n```\nImport extracts the import path\n\n```go\ntype AttributeModelDefMap map[string]*AttributeModelDef\n```\nAttributeModelDefMap contains data to map the three eav\\_attribute columns (backend | frontend | source | data)\\_model to the correct Go function and package. It contains mappings for Magento 1 \u0026 2. A developer has the option to change/extend the value using the file config\\_user.go with the init() func. Def for Definition to avoid a naming conflict :-( Better name?\n\n```go\ntype AttributeToStruct struct {\n\t// AttrPkgImp defines the package import path to use: possible ATM:\n\t// custattr and catattr and your custom EAV package.\n\tAttrPkgImp string\n\t// FuncCollection specifies the name of the SetAttributeCollection\n\t// function name within the AttrPkgImp.\n\tFuncCollection string\n\t// FuncGetter specifies the name of the SetAttributeGetter function name\n\t// within the AttrPkgImp.\n\tFuncGetter string\n\t// Package defines the name of the target package, must be external.\n\t// Default is {{.AttrPkgImp}}_test but for your project you must provide\n\t// your package name.\n\tPackage string\n\t// AttrStruct defines the name of the attribute struct in an EAV package\n\t// like catattr or custattr. This struct will have the prefix of\n\t// AttrPkgImp and will be embedded the newly generated struct which\n\t// wraps additional project specific columns.\n\tAttrStruct string\n\t// MyStruct is the optional name of your struct from your package. @todo review\n\tMyStruct string\n\t// OutputFile specifies the full path where to write the newly generated\n\t// code\n\tOutputFile string\n}\n```\nAttributeToStruct contains the configuration to materialize all attributes belonging to one EAV model\n\n```go\ntype AttributeToStructMap map[string]*AttributeToStruct\n```\nAttributeToStructMap contains as key the name of the EAV entity and points to its configuration.\n\n```go\ntype Columns []column\n```\nColumns contains a slice to pointer column types. A column has the fields: Field, Type, Null, Key, Default and Extra of type sql.NullString and GoType, GoName of type string.\n\n```go\nfunc (cc Columns) MapSQLToGoDBRType() error\n```\nMapSQLToGoDBRType takes a slice of Columns and sets the fields GoType and GoName to the correct value to create a Go struct. These generated structs are mainly used in a result from a SQL query. The field GoType will contain dbr.Null\\* types.\n\n```go\nfunc (cc Columns) MapSQLToGoType(ifm map[string]string) error\n```\nMapSQLToGoType maps a column to a GoType. This GoType is not a dbr.Null\\* struct. This function only updates the fields GoType and GoName of column struct. The 2nd argument ifm interface map replaces the primitive type with an interface type, the column name must be found as a key in the map.\n\n```go\ntype EntityType struct {\n\t// EntityModel Go type which implements eav.EntityTypeModeller. Will be\n\t// used as template so you can access the current entity_type from the\n\t// database.\n\tEntityModel string\n\t// AttributeModel Go type which implements\n\t// eav.EntityTypeAttributeModeller Will be used as template so you can\n\t// access the current entity_type from the database.\n\tAttributeModel string\n\t// EntityTable Go type which implements eav.EntityTypeTabler Will be\n\t// used as template so you can access the current entity_type from the\n\t// database.\n\tEntityTable string\n\t// IncrementModel Go type which implements\n\t// eav.EntityTypeIncrementModeller Will be used as template so you can\n\t// access the current entity_type from the database.\n\tIncrementModel string\n\t// AdditionalAttributeTable Go type which implements\n\t// eav.EntityTypeAdditionalAttributeTabler Will be used as template so\n\t// you can access the current entity_type from the database.\n\tAdditionalAttributeTable string\n\t// EntityAttributeCollection Go type which implements\n\t// eav.EntityTypeAttributeCollectioner Will be used as template so you\n\t// can access the current entity_type from the database.\n\tEntityAttributeCollection string\n\n\t// TempAdditionalAttributeTable string which defines the existing table\n\t// name and specifies more attribute configuration options besides\n\t// eav_attribute table. This table name is used in a DB query while\n\t// materializing attribute configuration to Go code.\n\t// Mage_Eav_Model_Resource_Attribute_Collection::_initSelect()\n\tTempAdditionalAttributeTable string\n\n\t// TempAdditionalAttributeTableWebsite string which defines the existing\n\t// table name and stores website-dependent attribute parameters. If an\n\t// EAV model doesn't demand this functionality, let this string empty.\n\t// This table name is used in a DB query while materializing attribute\n\t// configuration to Go code.\n\t// Mage_Customer_Model_Resource_Attribute::_getEavWebsiteTable()\n\t// Mage_Eav_Model_Resource_Attribute_Collection::_getEavWebsiteTable()\n\tTempAdditionalAttributeTableWebsite string\n\n\tAttributeCoreColumns slices.String\n}\n```\nEntityType is configuration struct which maps the PHP classes to Go types, interfaces and table names. Each struct field has a special import path with a function to make it easier to specify different packages.\n\n```go\ntype EntityTypeMap map[string]*EntityType\n```\nEntityTypeMap uses a string key as for the EAV entity type, which must also exists in the table eav\\_EntityTable, for maybe later manipulation in config\\_user.go and as value a pointer to a EntityType struct. Developers can later use the init() func in config\\_user.go to change the value of variable ConfigEntityType. The values of EntityType will be uses for materialization in Go code of the eav\\_entity\\_type table data.\n\n```go\nfunc (m EntityTypeMap) Keys() []string\n```\nKeys returns all keys from a EntityTypeMap\n\n```go\ntype OFile string\n```\nOFile is a OutputFile\n\n```go\nfunc NewOFile(paths ...string) OFile\n```\nNewOFile creates a new path from parts\n\n```go\nfunc (of OFile) AppendDir(s ...string) OFile\n```\n\n```go\nfunc (of OFile) AppendName(s ...string) OFile\n```\n\n```go\nfunc (of OFile) String() string\n```\n\n```go\ntype StringEntities map[string]string\n```\nStringEntities contains as key the column name and value the string value from the column. sql.RawBytes are converted to a string.\n\n```go\nfunc LoadStringEntities(db *sql.DB, dbSelect *dbr.Select) ([]StringEntities, error)\n```\nLoadStringEntities executes a SELECT query and returns a slice containing columns names and its string values\n\n```go\ntype TableToStruct struct {\n\t// Package defines the name of the target package\n\tPackage string\n\t// OutputFile specifies the full path where to write the newly generated code.\n\t// The file extension .go will be added automatically.\n\tOutputFile OFile\n\t// QueryString SQL query to filter all the tables which you desire, e.g.\n\t// catalog\\_% OR select table from information_schema ...\n\t// This query must specify all tables you need for a package.\n\tSQLQuery string\n\t// EntityTypeCodes If provided then eav_entity_type.value_table_prefix\n\t// will be evaluated for further tables.\n\tEntityTypeCodes []string\n\t// GenericsWhiteList config option as a SQL query to select all tables\n\t// for which it should generate the generic functions. If empty nothing\n\t// gets generated. If GenericsWhiteList contains the word SQLQuery then\n\t// the query will be copied from SQLQuery field and all tables receive\n\t// the generated functions.\n\tGenericsWhiteList string\n\t// GenericsFunctions specify which functions you need in the whole\n\t// package\n\tGenericsFunctions tpl.Generics\n}\n```\n\n```go\ntype TableToStructMap map[string]TableToStruct\n```\nTableToStructMap uses a string key as easy identifier for maybe later manipulation in config\\_user.go and a pointer to a TableToStruct struct. Developers can later use the init() func in config\\_user.go to change the value of variable ConfigTableToStruct.\n\n```go\ntype TypeCodeValueTable map[string]map[string]string\n```\nTypeCodeValueTable 2 dimensional map. 1. key entity\\_type\\_code 2. key table name =\u003e value ValueSuffix\n\n```go\nfunc GetEavValueTables(dbrConn *dbr.ConnPool, entityTypeCodes []string) (TypeCodeValueTable, error)\n```\nGetEavValueTables returns a map of all custom and default EAV value tables for entity type codes. Despite value\\_table\\_prefix can have in Magento a different table name we treat it here as the table name itself. Not thread safe.\n\n```go\nfunc (m TypeCodeValueTable) Empty() bool\n```\nEmpty checks if the map is empty or has an empty \"\" entry.\n\n```go\ntype ValueSuffixes []string\n```\nValueSuffixes contains the suffixes for an entity type table, e.g. datetime, decimal, int ... then a table value name would be catalog\\_product\\_entity\\_datetime, catalog\\_product\\_entity\\_decimal, ...\n\n```go\nfunc (vs ValueSuffixes) String() string\n```\nString joins the slice of strings separated by a comma. Only for debug.\n\n","path":"github.com/weiwolves/pkg/_codegen","name":"codegen","synopsis":"Package codegen is deprecated and generates Go code and is only used in development.","isRedistributable":true}
