当前位置: 首页>>代码示例>>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;未经允许,请勿转载。