使用集合过滤器和操作方法的Magento
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用集合过滤器和操作方法的Magento相关的知识,希望对你有一定的参考价值。
A collection is a Model type containing other Models, it is basically used in Magento to handle product lists (ie. from a category or a bundle option), but not only.TO DO: Explain how Magento Implements a collection - Use this to explain how Magento implements a collection by looking at code in a model, so that people can learn to write their own collections
This is a simple example of loading some product collection from a category and ordering them on their product name using Magento’s API.
)); 'from' => '2000-09-10', )); 'from' => '10 September 2000', 'from' => '11 September 2000', 'date' => true, // specifies conversion of comparison values )); $collection->addAttributeToFilter('field_name', 1); // tests for equality // Add OR condition: 'attribute' => 'field_name', ), 'attribute' => 'date_field', 'from' => '2000-09-10', ), ));
以上是关于使用集合过滤器和操作方法的Magento的主要内容,如果未能解决你的问题,请参考以下文章
Magento模型集合addFieldToFilter常用过滤条件