本文整理匯總了PHP中Google_Utils::camelCase方法的典型用法代碼示例。如果您正苦於以下問題:PHP Google_Utils::camelCase方法的具體用法?PHP Google_Utils::camelCase怎麽用?PHP Google_Utils::camelCase使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Google_Utils
的用法示例。
在下文中一共展示了Google_Utils::camelCase方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: convertAttribute
/**
* Set current attribute to entry (for specified product)
*
* @param Mage_Catalog_Model_Product $product
* @param Google_Service_ShoppingContent_Product $shoppingProduct
* @return Google_Service_ShoppingContent_Product
*/
public function convertAttribute($product, $shoppingProduct)
{
if (is_null($this->getName())) {
return $shoppingProduct;
}
$productAttribute = Mage::helper('googleshoppingapi/product')->getProductAttribute($product, $this->getAttributeId());
$type = $this->getGcontentAttributeType($productAttribute);
$value = $this->getProductAttributeValue($product);
if (!is_null($value)) {
$name = Google_Utils::camelCase($this->getName());
$shoppingProduct->offsetSet($name, $value);
}
return $shoppingProduct;
}
示例2: mapTypes
/**
* Initialize this object's properties from an array.
*
* @param array $array Used to seed this object's properties.
* @return void
*/
protected function mapTypes($array)
{
// Hard initilise simple types, lazy load more complex ones.
foreach ($array as $key => $val) {
if (!property_exists($this, $this->keyType($key)) && property_exists($this, $key)) {
$this->{$key} = $val;
unset($array[$key]);
} elseif (property_exists($this, $camelKey = Google_Utils::camelCase($key))) {
// This checks if property exists as camelCase, leaving it in array as snake_case
// in case of backwards compatibility issues.
$this->{$camelKey} = $val;
}
}
$this->modelData = $array;
}