- 浏览: 13763966 次
- 性别:
- 来自: 洛杉矶
-
文章分类
- 全部博客 (1994)
- Php / Pear / Mysql / Node.js (378)
- Javascript /Jquery / Bootstrap / Web (435)
- Phone / IOS / Objective-C / Swift (137)
- Ubuntu / Mac / Github / Aptana / Nginx / Shell / Linux (335)
- Perl / Koha / Ruby / Markdown (8)
- Java / Jsp (12)
- Python 2 / Wxpython (25)
- Codeigniter / CakePHP (32)
- Div / Css / XML / HTML5 (179)
- WP / Joomla! / Magento / Shopify / Drupal / Moodle / Zimbra (275)
- Apache / VPN / Software (31)
- AS3.0/2.0 / Flex / Flash (45)
- Smarty (6)
- SEO (24)
- Google / Facebook / Pinterest / SNS (80)
- Tools (22)
最新评论
-
1455975567:
xuezhongyu01 写道wocan23 写道我想问下那个 ...
Mysql: LBS实现查找附近的人 (两经纬度之间的距离) -
xuezhongyu01:
wocan23 写道我想问下那个111.1是怎么得来的我也看不 ...
Mysql: LBS实现查找附近的人 (两经纬度之间的距离) -
18335864773:
试试 pageoffice 在线打开 PDF 文件吧. pag ...
jquery在线预览PDF文件,打开PDF文件 -
青春依旧:
opacity: 0.5; 个人喜欢这种方式!关于其他css特 ...
css透明度的设置 (兼容所有浏览器) -
July01:
推荐用StratoIO打印控件,浏览器和系统的兼容性都很好,而 ...
搞定网页打印自动分页问题
magento EAV数据库Magento EAV structure & role of eav_attribute’s backend_type field
Introduction:
Magento database is based on EAV(Entity Attribute Value) architecture. And it uses this architecture especially for categories, products, customers & customer addresses.
Before Magento version 1.4.x it used EAV structure for orders as well
but thereafter order’s eav structure has been converted to flat
structure.
From the defination of EAV:
Entity(E):
Entity actually refers to data item.
In Magento:
catalog_category_entity catalog_product_entity customer_entity customer_address_entity
are the entity tables for categories, products, customers & customer addresses respectively.
Attribute(A):
Attribute refers to the different attributes of an Entity.
In Magento, attributes related to an entity are stored in a single
table: eav_attribute but differentiated by field: entity_type_id.
We can easily find all the attributes related to an entity using the following SQL query(For Example: product):
SELECT attribute_code, attribute_id, backend_type FROM eav_attribute WHERE entity_type_id = (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product')
Which gives the following results:
+----------------------------+--------------+--------------+ | attribute_code | attribute_id | backend_type | +----------------------------+--------------+--------------+ | activation_information | 496 | text | | color | 272 | int | | color_code | 950 | varchar | | computer_manufacturers | 510 | int | | contrast_ratio | 875 | int | | cost | 100 | decimal | | country_orgin | 507 | text | | cpu_speed | 877 | int | | created_at | 930 | static | | custom_design | 571 | varchar | | custom_design_from | 572 | datetime | | custom_design_to | 573 | datetime | | custom_layout_update | 531 | text | | description | 97 | text | | dimension | 494 | text | | enable_googlecheckout | 903 | int | | finish | 509 | text | | gallery | 271 | varchar | | gender | 501 | int | | gift_message_available | 562 | varchar | | harddrive_speed | 878 | varchar | | hardrive | 499 | text | | has_options | 838 | static | | image | 106 | varchar | | image_label | 879 | varchar | | in_depth | 492 | text | | is_imported | 949 | int | | is_recurring | 933 | int | | links_exist | 947 | int | | links_purchased_separately | 904 | int | | links_title | 906 | varchar | | manufacturer | 102 | int | | max_resolution | 873 | varchar | | media_gallery | 703 | varchar | | megapixels | 513 | int | | memory | 498 | text | | meta_description | 105 | varchar | | meta_keyword | 104 | text | | meta_title | 103 | varchar | | minimal_price | 503 | decimal | | model | 495 | text | | name | 96 | varchar | | news_from_date | 704 | datetime | | news_to_date | 705 | datetime | | old_id | 110 | int | | options_container | 836 | varchar | | package_id | 951 | int | | page_layout | 929 | varchar | | price | 99 | decimal | | price_type | 859 | int | | price_view | 862 | int | | processor | 497 | text | | ram_size | 874 | varchar | | recurring_profile | 934 | text | | required_options | 837 | static | | response_time | 876 | varchar | | room | 508 | int | | samples_title | 905 | varchar | | screensize | 500 | text | | shape | 476 | text | | shipment_type | 863 | int | | shipping_qty | 952 | int | | shirt_size | 525 | int | | shoe_size | 502 | int | | shoe_type | 107 | int | | short_description | 506 | text | | sku | 98 | static | | sku_type | 860 | int | | small_image | 109 | varchar | | small_image_label | 880 | varchar | | special_from_date | 568 | datetime | | special_price | 567 | decimal | | special_to_date | 569 | datetime | | status | 273 | int | | tax_class_id | 274 | int | | thumbnail | 493 | varchar | | thumbnail_label | 881 | varchar | | tier_price | 270 | decimal | | updated_at | 931 | static | | url_key | 481 | varchar | | url_path | 570 | varchar | | visibility | 526 | int | | weight | 101 | decimal | | weight_type | 861 | int | +----------------------------+--------------+--------------+
Similarly you can find attributes for other entities just by using following values for entity_type_code:
catalog_category customer customer_address
or categories, customers & customer address respectively.
Note: You can get the related values for entity_type_code from table: eav_entity_type.
Value(V):
Value refers to the actual value of the attribute of the entity.
In Magento attribute values of an entity (for example: product) are stored in catalog_product_entity_[backend_type] tables.
Where [backend_type] refers to the value of field: backend_type (except value ‘static’) of table: eav_attribute.
Following SQL is used to find all the backend types related to a product entity:
SELECT DISTINCT backend_type FROM eav_attribute WHERE entity_type_id = (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product')
Which results:
+--------------+ | backend_type | +--------------+ | text | | int | | varchar | | decimal | | static | | datetime | +--------------+
So tables:
catalog_product_entity_text catalog_product_entity_int catalog_product_entity_varchar catalog_product_entity_decimal catalog_product_entity_datetime
are used for storing values for an attributes of related backend_type.
Note: You must be wondering about backend_type = static. For an attribute with the static backend_type, values are stored as a column directly in the entity table. For example: sku is an attribute of backend_type = static and it’s values are stored in the entity table itself: catalog_product_entity under field: sku.
That’s all about the definition of EAV relating to Magento.
Hopefully now you are able to differentiate which attribute values goes where (in which table) based on the backend_type.
Thanks for reading & Happy E-Commerce!!
来源:http://www.blog.magepsycho.com/magento-eav-structure-role-of-eav_attributes-backend_type-field/
发表评论
-
Magento: 后台显示图片不能找到 Image file was not found on product tab
2016-08-30 02:22 3005I was uploading some images f ... -
理解WordPress的PingBack和TrackBack
2016-08-26 02:21 5811pingback和trackback的功 ... -
零基础 Amazon Web Services (AWS) 入门教程图文版(四)
2016-06-07 11:40 1037自上一篇之后,5天过去了,这篇文章总算是挤出来了... 其实 ... -
零基础 Amazon Web Services (AWS) 入门教程图文版(三)
2016-06-07 11:41 2063原则上WDCP安装好了,就可以直接使用了,FTP、MySQL ... -
零基础 Amazon Web Services (AWS) 入门教程图文版(二)
2016-06-07 01:33 1021上一篇讲到,主机正常运转了。但是此时如果直接访问公网IP是 ... -
零基础 Amazon Web Services (AWS) 入门教程图文版(一)
2016-06-07 01:31 21807现在小站唯一的流量都靠AWS这个关键词了,刚好要用AWS重新 ... -
零基础 Amazon Web Services (AWS) 入门教程 (列表)
2016-06-07 01:32 2099在 Amazon Web Services 上托 ... -
Magento 1.9:新订单通知 Admin Order Notifier
2016-06-02 02:48 870Here is a little Mag ... -
Magento 1.9.X 系列教程
2016-05-14 02:44 2305Magento安装下载教学: Magento教程 1 ... -
Magento: 产品页面下jquery change函数失效 Call javascript function onchange product option
2016-05-05 06:39 1776明显的原因是change函数跟magento默认的oncha ... -
Magento: 判断是否为手机浏览 Optimise Web's Mobile Detect Class for Magento
2016-04-29 07:01 1178项目地址:Optimise Web's Mobile Det ... -
Magento: Gird 和 form 区域 Module Development Series – Magento Admin Module
2016-04-28 02:39 690In this tutorial, we are goi ... -
Magento: addAttributeToFilter 和 addFieldToFilter 的区别 Difference between addAttri
2016-04-28 02:34 1027addAttributeToFilter is use ... -
Magento: 后台获取menu链接 Getting the admin panel urls
2016-04-28 02:34 791The url for customer page in t ... -
Magento : 调用文件上传 upload file frontend
2016-04-27 01:25 1377bool mkdir ( string $pathname ... -
Magento: 自定义用户登录导向页面 Redirect Customer to Previous Page After Login
2016-04-26 02:45 1869Configuration Settings – L ... -
Magento: 代替flash上传 How to disable Flash uploader in Magento (product images and
2016-04-06 05:04 11401. 替换产品页flash上传按钮 - 使用 Du ... -
Magento: 在客户账户中添加自定义链接 My Account Add Link
2016-04-05 14:05 1420This extension add new link an ... -
Magento: 根据产品属性加载产品信息 Load A Category or Product by an Attribute
2016-03-26 01:35 961Load a Product by ID <?ph ... -
Magento模块开发之数据库SQL操作方法说明
2016-03-26 01:31 1395今天主要来看Magento中的Mysql4/Resource ...
相关推荐
此代码仅供参考没有后台管理表格1.8版本下可用 ...2.eav_attribute,eav_attribute_group,eav_attribute_set,eav_entity_attribute,eav_entity_type 每个表多一条数据。 作者网站:http://www.sharpmagento.com/
Magento 商城数据库是一个关键组成部分,它是 Magento 电子商务平台的核心,负责存储所有商品信息、客户数据、订单记录以及网站配置等重要信息。Magento 是一个开源的电子商务解决方案,以其强大的功能和高度可定制...
自定义属性则存储在`eav_attribute`、`eav_attribute_set`、`eav_entity_type`和`catalog_eav_attribute`等表中。因此,批量导出产品和自定义属性需要联合查询这些表。 `magento导出产品sql.php`可能包含了一个SQL...
标题:Magento 数据库设计图 描述:Magento 数据库设计图旨在提供一个清晰的视图,帮助用户理解 Magento 系统内部的数据结构与关联性。通过这张设计图,开发者和DBA能够快速掌握数据库中各表之间的关系,以及它们在...
本资源“Magento数据库 以及时尚模板”显然是针对服装类商家,提供了数据库配置和时尚设计的解决方案。 首先,让我们详细探讨Magento数据库的构建和管理。Magento的核心功能之一是其复杂的商品目录系统,这依赖于一...
MageHost_Cm_Cache_Backend MageHost扩展版的Colin Mollenhour的Cm_Cache_Backend_File和Cm_Cache_Backend_Redis安装安装 cd到您的Magento根目录test -d .modman || modman init modman clone --copy --force ...
18. **EAV**, **SALES**, **SYSTEM**:EAV模型、销售模块和系统模块,构成了Magento的核心架构。 19. **MAGENTO-DatabaseDiagram[v1.1.6]**:这是Magento数据库结构的版本化图表,展示了数据库的完整设计。 20. **...
SELECT attribute_id FROM eav_attribute WHERE entity_type_id = 4 AND frontend_label LIKE '%产品名称%' OR frontend_label LIKE '%产品描述%'; ``` 2. **构建UPDATE语句**:使用找到的`attribute_id`,构造...
当涉及到Magento站点的迁移时,一个常见的方法是通过使用PHPMyAdmin来导入数据库,这种方法不仅高效,而且能够确保数据的完整性和一致性。下面,我们将深入探讨Magento通过PHPMyAdmin方式做站点迁移的具体步骤、注意...
Magento 2的Dmatthew_AttributeDescription模块这是一个Magento 2模块,它增加了向产品属性添加描述的功能。 将描述添加到可配置属性,并将其显示在您的产品视图页面上。 使用属性描述可以帮助向客户解释复杂的属性...
在电子商务领域,商家可能会面临更换电商平台的情况,例如从ZenCart迁移到Magento。这两个都是流行的开源购物车系统,但Magento提供了更多的功能和扩展性。本文将详细介绍如何进行Zencart到Magento的数据迁移,尤其...
Magento是一个功能强大的开源电子商务解决方案,由于其庞大的功能集合和灵活的架构,其数据库设计相对复杂。Magento数据库包含超过250张表,每张表都承载了不同模块和功能的数据存储和业务逻辑。这些表之间存在大量...
2. **EAV模型**:Entity-Attribute-Value(EAV)模型是Magento数据存储的关键特性,允许存储具有动态属性的商品信息。`EAV(E-V图 product为例).png`和`EAV模型.png`可能展示了如何通过EAV结构存储和检索商品数据。 ...
Magento是一款强大的开源电子商务...总之,快速复制Magento站点涉及多个层面的工作,包括数据库迁移、文件复制、配置调整和缓存处理。正确执行这些步骤将帮助你高效地在新环境中搭建起一个与原站点相似的Magento商店。
Cm_Cache_Backend_File 可用的Zend_Cache_Backend_File后端在使用标签进行清理时性能极差,这使得随着缓存项目数量的增加,后端变得不可用。 该后端进行了许多更改,从而极大地提高了性能,尤其是在标签清洗方面。 ...
**解释**:在Magento系统中,加载产品属性需要满足两个关键条件:首先,属性的基本信息需存储在eav_attribute表中,包括属性的特性和所属的实体类型;其次,此属性应属于当前加载产品的属性集,确保其与特定产品的...
Rubic_Cache_Backend_Aerospike 这是什么? Magento 缓存后端,用于名为的内存中 NoSQL 数据库。 为什么? Aerospike 真的很容易横向扩展(与 Redis Clustering 相比)。 它也真的。 数据性感的。 为了乐趣和...
#### 2.9 `adminhtml_product_attribute_types` #### 2.10 `adminhtml_catalog_product_edit_prepare_form` #### 2.11 `adminhtml_catalog_product_edit_element_types` 这些事件主要涉及产品属性和编辑表单的准备...
Magento 2.1.13汉化包是一个针对Magento电子商务平台的中文本地化解决方案,它使得在中国使用Magento的商家和开发者能够更方便地理解和操作这个强大的开源系统。Magento是一款广泛使用的开源电商框架,以其高度可...
Magento 2 数据库迁移将数据库从 Magento 1.8、1.9 迁移到 Magento 2 beta5。 该程序绝对没有任何保证。 对于每个新的 Magento2 发行版/预发行版,必须调整此模块,主要是在有新的安装脚本时。 此外,Magento2 将...