/** * If the "ExtendedAttributes/AllowGiftMessage" node exist then we proceed * to set the product attribute "use_config_gift_message_available" to false * and return the boolean value of the "ExtendedAttributes/AllowGiftMessage" node. * Otherwise, if the "ExtendedAttributes/AllowGiftMessage" node doesn't exists * we simply return null in order to let the default value be set on the attribute. * * @param DOMNodeList * @param Mage_Catalog_Model_Product * @return int | null */ public function extractAllowGiftMessage(DOMNodeList $nodes, Mage_Catalog_Model_Product $product) { if ($nodes->length) { $product->setUseConfigGiftMessageAvailable(0); // Explicitly casting the extracted boolean value as an integer value because // Magento only work with integer value 0 or 1 representing boolean value in the database. return (int) $this->coreHelper->parseBool($nodes->length ? $nodes->item(0)->nodeValue : null); } return null; }
/** * Get a boolean value. * * @param IOrderSummary * @param string * @return mixed */ public function getBooleanValue(IOrderSummary $summary, $getter) { return $this->_coreHelper->parseBool($this->getStringValue($summary, $getter)); }
/** * Get a boolean value. * * @param IPayload * @param string * @return mixed */ protected function _getBooleanValue(IPayload $payload, $getter) { return $this->_coreHelper->parseBool($this->_getStringValue($payload, $getter)); }