Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/244.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用Magento';s ORM在我的自定义表和magento';什么桌子?_Php_Collections_Magento_Join_Attributes - Fatal编程技术网

Php 如何使用Magento';s ORM在我的自定义表和magento';什么桌子?

Php 如何使用Magento';s ORM在我的自定义表和magento';什么桌子?,php,collections,magento,join,attributes,Php,Collections,Magento,Join,Attributes,我需要在我的自定义表和一个Magento的实体表之间建立一个内部联接。。如何使用Magento的ORM模型实现这一点 提前非常感谢。通读官方文件,并查看joinTable、joinField和joinAttribute方法 下面是一个连接与Orders集合相关的表的示例: $this->_orders = Mage::getResourceModel('sales/order_collection') ->addAttributeToSelect('*')

我需要在我的自定义表和一个Magento的实体表之间建立一个内部联接。。如何使用Magento的ORM模型实现这一点

提前非常感谢。

通读官方文件,并查看
joinTable
joinField
joinAttribute
方法

下面是一个连接与Orders集合相关的表的示例:

$this->_orders = Mage::getResourceModel('sales/order_collection')
        ->addAttributeToSelect('*')
        ->joinAttribute('billing_firstname', 'order_address/firstname', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_lastname', 'order_address/lastname', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_street', 'order_address/street', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_company', 'order_address/company', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_city', 'order_address/city', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_region', 'order_address/region', 'billing_address_id', null, 'left')
        ->joinAttribute('billing_country', 'order_address/country_id', 'billing_address_id', null, 'left')
        ->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')
        ->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')
        ->joinAttribute('shipping_street', 'order_address/street', 'shipping_address_id', null, 'left')
        ->joinAttribute('shipping_company', 'order_address/company', 'shipping_address_id', null, 'left')
        ->joinAttribute('shipping_telephone', 'order_address/telephone', 'shipping_address_id', null, 'left')
        ->joinAttribute('shipping_fax', 'order_address/fax', 'shipping_address_id', null, 'left');
你还应该回顾一下已经尝试过的方法及其效果的例子

HTH,
法学博士