當前位置: 首頁>>代碼示例>>Golang>>正文


Golang eav.NewAttributeSource函數代碼示例

本文整理匯總了Golang中github.com/corestoreio/csfw/eav.NewAttributeSource函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewAttributeSource函數的具體用法?Golang NewAttributeSource怎麽用?Golang NewAttributeSource使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了NewAttributeSource函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: AddressSourceCountry

// AddressSourceCountry retrieves slice of countries @todo
// @see magento2/site/app/code/Magento/Customer/Model/Resource/Address/Attribute/Source/Country.php
func AddressSourceCountry() *eav.AttributeSource {
	return eav.NewAttributeSource(
		// temporary because later these values comes from another slice/container/database
		func(as *eav.AttributeSource) {
			as.Source = []string{
				"AU", "Straya",
				"NZ", "Kiwi land",
				"DE", "Autobahn",
				"SE", "Smørrebrød",
			}
		},
	)
}
開發者ID:hafeez3000,項目名稱:csfw,代碼行數:15,代碼來源:address_source.go

示例2: AddressSourceRegion

// AddressSourceRegion
// @see magento2/site/app/code/Magento/Customer/Model/Resource/Address/Attribute/Source/Region.php
func AddressSourceRegion() *eav.AttributeSource {
	return eav.NewAttributeSource(
		// temporary because later these values comes from another slice/container/database
		func(as *eav.AttributeSource) {
			as.Source = []string{
				"BAY", "Bavaria",
				"BAW", "Baden-Würstchenberg",
				"HAM", "Hamburg",
				"BER", "Bärlin",
			}
		},
	)
}
開發者ID:hafeez3000,項目名稱:csfw,代碼行數:15,代碼來源:address_source.go

示例3: TestAttributeSource

func TestAttributeSource(t *testing.T) {
	a := eav.NewAttributeSource(
		// temporary because later these values comes from another slice/container/database
		func(as *eav.AttributeSource) {
			as.Source = []string{
				"BAY", "Bavaria",
				"BAW", "Baden-Würstchenberg",
				"HAM", "Hamburg",
				"BER", "Bärlin",
			}
		},
	)
	assert.Equal(
		t,
		eav.AttributeSourceOptions{eav.AttributeSourceOption{Value: "BAY", Label: "Bavaria"}, eav.AttributeSourceOption{Value: "BAW", Label: "Baden-Würstchenberg"}, eav.AttributeSourceOption{Value: "HAM", Label: "Hamburg"}, eav.AttributeSourceOption{Value: "BER", Label: "Bärlin"}},
		a.GetAllOptions(),
	)

}
開發者ID:hafeez3000,項目名稱:csfw,代碼行數:19,代碼來源:attribute_source_test.go

示例4: ProductSourceVisibility

// ProductSourceVisibility @todo
// @see magento2/site/app/code/Magento/Catalog/Model/Product/Visibility.php
// This class is misplaced in Magento2 maybe they move it to the correct location ...
func ProductSourceVisibility() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
開發者ID:joao-parana,項目名稱:csfw,代碼行數:6,代碼來源:product_source.go

示例5: ProductSourceStatus

// ProductSourceStatus @todo
// @see magento2/site/app/code/Magento/Catalog/Model/Product/Attribute/Source/Status.php
func ProductSourceStatus() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
開發者ID:joao-parana,項目名稱:csfw,代碼行數:5,代碼來源:product_source.go

示例6: ProductSourceLayout

// ProductSourceLayout @todo
// @see magento2/site/app/code/Magento/Catalog/Model/Product/Attribute/Source/Layout.php
func ProductSourceLayout() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
開發者ID:joao-parana,項目名稱:csfw,代碼行數:5,代碼來源:product_source.go

示例7: ProductSourceDesignOptionsContainer

// ProductSourceDesignOptionsContainer @todo
// @see magento2/site/app/code/Magento/Catalog/Model/Entity/Product/Attribute/Design/Options/Container.php
// @see magento2/site/app/code/Magento/Catalog/etc/di.xml Line ~109
func ProductSourceDesignOptionsContainer() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
開發者ID:joao-parana,項目名稱:csfw,代碼行數:6,代碼來源:product_source.go

示例8: ProductSourceCountryOfManufacture

// ProductSourceCountryOfManufacture @todo hand out price for longest name ;-)
// @see magento2/site/app/code/Magento/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php
func ProductSourceCountryOfManufacture() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
開發者ID:joao-parana,項目名稱:csfw,代碼行數:5,代碼來源:product_source.go

示例9: CustomerSourceWebsite

// CustomerSourceWebsite handle store source @todo
// @see magento2/site/app/code/Magento/Customer/Model/Customer/Attribute/Source/Website.php
func CustomerSourceWebsite() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
開發者ID:joao-parana,項目名稱:csfw,代碼行數:5,代碼來源:customer_source.go

示例10: CustomerSourceGroup

// CustomerSourceGroup customer group handling @todo
// @see magento2/site/app/code/Magento/Customer/Model/Customer/Attribute/Source/Group.php
func CustomerSourceGroup() todoASG {
	return todoASG{
		AttributeSource: eav.NewAttributeSource(),
	}
}
開發者ID:joao-parana,項目名稱:csfw,代碼行數:7,代碼來源:customer_source.go

示例11: CategorySourceMode

// CategorySourceMode @todo
// @see magento2/site/app/code/Magento/Catalog/Model/Category/Attribute/Source/Mode.php
func CategorySourceMode() *todoCASMode {
	return &todoCASMode{
		AttributeSource: eav.NewAttributeSource(),
	}
}
開發者ID:hafeez3000,項目名稱:csfw,代碼行數:7,代碼來源:category_source.go

示例12: CategorySourcePage

// CategorySourcePage @todo
// @see magento2/site/app/code/Magento/Catalog/Model/Category/Attribute/Source/Page.php
func CategorySourcePage() *todoCASP {
	return &todoCASP{
		AttributeSource: eav.NewAttributeSource(),
	}
}
開發者ID:hafeez3000,項目名稱:csfw,代碼行數:7,代碼來源:category_source.go

示例13: CategorySourceSortby

// CategorySourceSortby sorting @todo
// @see magento2/site/app/code/Magento/Catalog/Model/Category/Attribute/Source/Sortby.php
func CategorySourceSortby() *todoCASSB {
	return &todoCASSB{
		AttributeSource: eav.NewAttributeSource(),
	}
}
開發者ID:hafeez3000,項目名稱:csfw,代碼行數:7,代碼來源:category_source.go

示例14: NewAttributeSourcePrice

// NewAttributeSourcePrice @todo
// @see magento2/site/app/code/Magento/Msrp/Model/Product/Attribute/Source/Type/Price.php
func NewAttributeSourcePrice() *todoASPrice {
	return &todoASPrice{
		AttributeSource: eav.NewAttributeSource(),
	}
}
開發者ID:hafeez3000,項目名稱:csfw,代碼行數:7,代碼來源:attribute_source.go

示例15: AttributeSourceTaxClassCustomer

// AttributeSourceTaxClassCustomer @todo
// @see magento2/site/app/code/Magento/Tax/Model/TaxClass/Source/Customer.php
func AttributeSourceTaxClassCustomer() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
開發者ID:hafeez3000,項目名稱:csfw,代碼行數:5,代碼來源:attribute_source.go


注:本文中的github.com/corestoreio/csfw/eav.NewAttributeSource函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。