当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Eav_Model_Entity_Setup::getEntityType方法代码示例

本文整理汇总了PHP中Mage_Eav_Model_Entity_Setup::getEntityType方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Eav_Model_Entity_Setup::getEntityType方法的具体用法?PHP Mage_Eav_Model_Entity_Setup::getEntityType怎么用?PHP Mage_Eav_Model_Entity_Setup::getEntityType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Eav_Model_Entity_Setup的用法示例。


在下文中一共展示了Mage_Eav_Model_Entity_Setup::getEntityType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: int

<?php

/**
 *
 * @category   Directshop
 * @package    Directshop_FraudDetection
 * @author     Ben James
 * @copyright  Copyright (c) 2008-2010 Directshop Pty Ltd. (http://directshop.com.au)
 */
$installer = $this;
$installer->startSetup();
$installer->run("\r\nDROP TABLE IF EXISTS {$this->getTable('frauddetection_data')};\r\nCREATE TABLE {$this->getTable('frauddetection_data')} (\r\n  `entity_id` int(10) NOT NULL auto_increment,\r\n  `order_id` int(10) NOT NULL,\r\n  `fraud_score` int(11) NULL DEFAULT '0',\r\n  `fraud_data` text NULL,\r\n  `sent_data` text NULL,\r\n  PRIMARY KEY  (`entity_id`),\r\n  KEY `order_id_idx` (`order_id`)\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n");
// transfer any old data across
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
if ($setup->getEntityType('order_payment') !== false) {
    $responseAttribute = $setup->getAttribute('order_payment', 'maxmind_response');
    $scoreAttribute = $setup->getAttribute('order', 'fraud_score');
    if ($responseAttribute && $setup->tableExists('sales_order_entity_text')) {
        $read = Mage::getSingleton('core/resource')->getConnection('core_read');
        $existingData = $read->fetchAll("select * from {$this->getTable('sales_order_entity_text')} where attribute_id = ?", array($responseAttribute['attribute_id']));
        foreach ($existingData as $data) {
            $parentId = $read->fetchOne("select parent_id from {$this->getTable('sales_order_entity')} where entity_id = ?", array($data['entity_id']));
            $fraudScore = 0;
            if ($scoreAttribute) {
                $fraudScore = $read->fetchOne("select value from {$this->getTable('sales_order_int')} where entity_id = ? AND attribute_id = ?", array($parentId, $scoreAttribute['attribute_id']));
            } else {
                $fraudData = @unserialize($data['value']);
                if (isset($fraudData['ourscore'])) {
                    $fraudScore = $fraudData['ourscore'];
                }
            }
开发者ID:AleksNesh,项目名称:pandora,代码行数:31,代码来源:mysql4-upgrade-0.2.0-1.0.php


注:本文中的Mage_Eav_Model_Entity_Setup::getEntityType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。