本文整理匯總了PHP中Miva\Provisioning\Builder\SimpleXMLElement::addAttribute方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleXMLElement::addAttribute方法的具體用法?PHP SimpleXMLElement::addAttribute怎麽用?PHP SimpleXMLElement::addAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Miva\Provisioning\Builder\SimpleXMLElement
的用法示例。
在下文中一共展示了SimpleXMLElement::addAttribute方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <ProductKit_Generate_Variants product_code="test" pricing_method="master"/>
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<ProductKit_Generate_Variants />');
$xmlObject->addAttribute('product_code', $this->getProductCode());
$xmlObject->addAttribute('pricing_method', $this->getPricingMethod());
return $xmlObject;
}
示例2: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <CategoryProduct_Assign category_code="Food" product_code="ale-gallon" />
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<CategoryProduct_Assign />');
$xmlObject->addAttribute('category_code', $this->getCategoryCode());
$xmlObject->addAttribute('product_code', $this->getProductCode());
return $xmlObject;
}
示例3: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <CouponPriceGroup_Assign coupon_code="xxx" group_name="yyy" />
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<CouponPriceGroup_Assign />');
$xmlObject->addAttribute('coupon_code', $this->getCouponCode());
$xmlObject->addAttribute('group_name', $this->getGroupName());
return $xmlObject;
}
示例4: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <AvailabilityGroupProduct_Assign group_name="Thief" product_code="kit-disguise" />
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<AvailabilityGroupCustomer_Assign />');
$xmlObject->addAttribute('group_name', $this->getGroupName());
$xmlObject->addAttribute('product_code', $this->getProductCode());
return $xmlObject;
}
示例5: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <ProductImage_Delete product_code="test" filepath="graphics/00000001/s2k_silver_front.jpg" />
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<ProductImage_Add></ProductImage_Add>');
$xmlObject->addAttribute('product_code', $this->getProductCode());
$xmlObject->addAttribute('filepath', $this->getFilePath());
return $xmlObject;
}
示例6: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <Order_Delete_Item order_id="1000" line_id="1000" />
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<Order_Delete_Item />');
$xmlObject->addAttribute('order_id', $this->getOrderId());
$xmlObject->addAttribute('line_id', $this->getLineId());
return $xmlObject;
}
示例7: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <Attribute_Option attribute_code="select" option_code="s1" />
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<Attribute_Option />');
$xmlObject->addAttribute('attribute_code', $this->getAttributeCode());
$xmlObject->addAttribute('option_code', $this->getOptionCode());
return $xmlObject;
}
示例8: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <ProductAttribute_Delete product_code="chest" attribute_code="bar" />
*
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<ProductAttribute_Delete />');
$xmlObject->addAttribute('product_code', $this->getProductCode());
$xmlObject->addAttribute('attribute_code', $this->getAttributeCode());
return $xmlObject;
}
示例9: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <Attribute_Boolean attribute_code="text" present="true"/>
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<Attribute_Boolean />');
$xmlObject->addAttribute('attribute_code', $this->getAttributeCode());
$xmlObject->addAttribute('present', $this->getPresent() ? 'true' : 'false');
return $xmlObject;
}
示例10: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <ShippingMethod module_code="upsxml" method_code="02" />
*
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<ShippingMethod />');
$xmlObject->addAttribute('module_code', $this->getModuleCode());
$xmlObject->addAttribute('method_code', $this->getMethodCode());
return $xmlObject;
}
示例11: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <CouponCustomer_Assign coupon_code="xxx" customer_login="yyy" />
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<CouponCustomer_Assign />');
$xmlObject->addAttribute('coupon_code', $this->getCouponCode());
$xmlObject->addAttribute('customer_login', $this->getCustomerLogin());
return $xmlObject;
}
示例12: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <ProductRelatedProduct_Unassign product_code="bolts" relatedproduct_code="bolts-silver" />
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<ProductRelatedProduct_Unassign />');
$xmlObject->addAttribute('product_code', $this->getProductCode());
$xmlObject->addAttribute('relatedproduct_code', $this->getRelatedProductCode());
return $xmlObject;
}
示例13: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <AttributeTemplate_Add code="spikes-armor" prompt="Armor Spikes" />
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<AttributeTemplate_Add />');
$xmlObject->addAttribute('code', $this->getCode());
$xmlObject->addAttribute('prompt', $this->getPrompt());
return $xmlObject;
}
示例14: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <Module code="customfields" feature="fields_prod">
* <ProductField_Delete code="code" />
* </Module>
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<Module />');
$xmlObject->addAttribute('code', 'customfields');
$xmlObject->addAttribute('feature', 'fields_prod');
$mainTag = $xmlObject->addChild('ProductField_Delete');
$mainTag->addAttribute('Code', $this->getCode());
return $xmlObject;
}
示例15: toXml
/**
* {@inheritDoc}
*
* Format:
*
* <Module code="discount_volume" feature="discount">
* <!-- Non-existent product -->
* <ProductPricingTable group_name="Volume Pricing Product Provisioning Test 01" product_code="non-existent" />
* </Module>
*/
public function toXml($version = Version::CURRENT, array $options = array())
{
$xmlObject = new SimpleXMLElement('<Module />');
$xmlObject->addAttribute('code', 'discount_volume');
$xmlObject->addAttribute('feature', 'discount');
foreach ($this->getProductPricingTables() as $productPricingTable) {
XmlHelper::appendToParent($xmlObject, $productPricingTable->toXml($version, $options));
}
return $xmlObject;
}