- 浏览: 150075 次
- 性别:
- 来自: 宁波
文章分类
最新评论
-
cxxllove:
请教一个问题,一个43K的图片上传后,图片仍然被压缩到17K, ...
magento 1.4-- 再论如何改善前台图片质量 -
anderson916:
可以访问我的网站: http://www.magento-ch ...
magento -- 给Magento提速之缓存上的探索
There are different important functions that you can implement in your Collection object. The functions are present in Varien_Data_Collection_Db class. The class file is present in lib/Varien/Data/Collection/Db.php
Here are some of the functions that you can use in your collection object:-
/**
* Get Zend_Db_Select instance
*/
$collection->getSelect();
/**
* Get collection size
*/
$collection->getSelect()->getSize();
/**
* Get sql select string or object
*/
$collection->getSelect()->getSelectSql();
/**
* Add select order
*/
$collection->getSelect()->setOrder($field, $direction);
/**
* Add field filter to collection
*
* If $attribute is an array will add OR condition with following format:
* array(
* array(‘attribute’=>’firstname’, ‘like’=>’test%’),
* array(‘attribute’=>’lastname’, ‘like’=>’test%’),
* )
*/
$collection->getSelect()->setOrder($field, $condition);
/**
* Set select distinct
*/
$collection->getSelect()->distinct($flag);
/**
* Get all data array for collection
*/
$collection->getSelect()->getData();
/**
* Reset loaded for collection data array
*/
$collection->getSelect()->resetData();
/**
* Print and/or log query
*/
$collection->getSelect()->printLogQuery(true, true);
More functions below:-
Varien_Data_Collection_Db class extends Varien_Data_Collection class. Here are some more functions present in Varien_Data_Collection class:-/**
* Get current collection page
*/
$collection->getSelect()->getCurPage();
/**
* Retrieve collection last page number
*/
$collection->getSelect()->getLastPageNumber();
/**
* Retrieve collection page size
*/
$collection->getSelect()->getPageSize();
/**
* Retrieve collection all items count
*/
$collection->getSelect()->getSize();
/**
* Retrieve collection first item
*/
$collection->getSelect()->getFirstItem();
/**
* Retrieve collection last item
*/
$collection->getSelect()->getLastItem();
/**
* Retrieve collection items
*/
$collection->getSelect()->getItems();
/**
* Clear collection
*/
$collection->getSelect()->clear();
You can also use the select functions as present in Zend_Db_Select class. This class file is present in lib/Zend/Db/Select.php
Hope this helps. Thanks.
来自:http://blog.chapagain.com.np/magento-collection-functions/
发表评论
-
magento -- 推荐插件 -- 购物车预览 --Cart items preview on mouseover
2011-04-24 11:47 2092名称: Cart items preview on m ... -
magento -- 修改代码让后台属性组合里的属性显示中文
2011-04-13 22:25 1531Magento后台属性组合管理里的各个属性显示的是属性 ... -
Magento安全设置 (转载)
2011-03-23 17:34 2653在现今的网络中,没有 ... -
magento插件手动下载
2011-03-13 20:03 1490http://freegento.com/ddl-magent ... -
magento开始办官方培训班了,课程价格真给力啊
2011-03-08 09:05 1767早上打开Magento官方站,发现顶栏多了一条东西,点进去 ... -
magento -- Magento1.5初探三
2011-02-12 22:18 1722接上文……………… PS:写 ... -
推荐两个Magento做的中文网站 GAP和佰草集
2010-11-18 22:23 978Magento这两年发展很快 ... -
magento 1.4 -- 推荐插件 -- 不错的图片放大查看插件 -- IG LightBox
2010-11-21 23:21 1026挺长时间没推荐插件了,虽然经常在看Magento官网,还是 ... -
magento -- 修改所有商品的价格为原来的1.2倍示例
2010-11-24 20:03 1538运行一遍如下代码可以使全站所有商品的价格变成原来的1.2倍 ... -
magento -- 设置满多少免运费
2010-11-25 17:17 1501第一步,到后台配置System->Configura ... -
Magento在CMS Page中增加用户信息变量
2010-11-30 14:31 767Magento的cms页面和static block页面中可 ... -
magento -- 给Magento提速之缓存上的探索
2010-12-07 20:54 2133依然在为Magento提速做努力,除了自带的缓存和编译,之前 ... -
magento -- 后台产品列表页默认只显示可见性为“Catalog, Search”的产品
2010-12-15 12:33 1381最近有客户提到,后台产品管理列表页面,管理产品很不方便,原 ... -
magento -- 推荐插件 -- 页面布局分析插件 -- Layout Analyzer
2010-12-24 15:41 1176名称: Layout Analyzer Extensi ... -
magento -- 推荐插件 -- 按字母过滤列表页产品 --alphabates
2010-12-29 21:43 1067名称: alphabates Extension Ke ... -
magento -- 关于更新订单状态的API接口函数
2010-12-30 17:10 1898做Magento和其他系统的对接时需要调用Magento的A ... -
magento -- 用Magento的方式读写XML
2011-01-10 14:06 1342I will be using Varien_Simplexm ... -
自己写的magento产品详细页添加下一件,上一件产品链接
2011-01-13 22:11 1885网上商城在产品详细页放上一件和下一件产品的链接在不少地方看到 ... -
magento -- 按某个属性排序上的一个尝试
2011-01-20 00:42 2019Magento的属性可以用来放在产品列表页给产品进行排序,要 ... -
magento -- Magento1.5初探一
2011-01-30 12:34 1516Magento的新一代版本1.5已经出到RC了,也就是说离正 ...
相关推荐
函数式编程(FP)是一种软件开发风格,它注重不依赖于编程状态的函数。函数式代码易于测试和复用,容易实现并发,且不容易受到bug的攻击。Scala是一种能很好支持函数式编程的新兴JVM语言。《Scala函数式编程》是针对...
获取扩展名,列名字符和数字的转换等自定义函数
mybatis 多层级collection嵌套
Collection 是所以集合的基类,该实例主要对Collection集合的成员函数的练习以及Iterator和foreach的遍历集合的练习,试用与java/C++ 新手。。
Denise Milani Video Collection
集合框架包含collection和map的子类。其中collection包含list、set和queue。map包括hashmap、hashtable和treemap
Mesh Deformation Full Collection.unitypackage
Dictionary比Collection慢好多; 采用了高精度计时器进行比较,可以精确到微秒; 添加速度快1-2倍 读取快3倍 删除有时快5倍 具体数据量不一样,CPU和电脑不同,结果也不同。 Dictionary,加20万条,用时2371.5783毫秒...
Collection集合简单测试 //添加元素c.add("孙悟空"); //删除指定元素c.remove(6);
前几天学习了collection的文档,里面主要是collection的基础知识,大神们自动忽略吧
mybatis中mapper文件resultMap中collection和association的使用,参考地址:https://blog.csdn.net/zhizhuodewo6/article/details/82863452
C++ Collection.zip
Collection集合
UML files collection2
java Collection类整理
在云开发中,使用云函数会有很多坑。 1.调用云函数的时候,云函数调试时返回值不是null,但是到了前端拿到的result却是null。 2.调试云函数,本地调试和云端测试/真机测试结果不一样。表现为本地测试正常运行,云端...
这是论文An Unconstrained Optimization Test Functions Collection里的测试函数,用Matlab写好了。
Collection使用
Delphi Examples Collection 3.0 This collection will help you to quickly and simply adopt and apply the knowledge of experienced programmers. What you will find here is a set of examples for most used ...
The Animation Collection..zip,动画集合。