博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
phalcon: 查找记录(Finding Records)可用的查询设置如下:
阅读量:6407 次
发布时间:2019-06-23

本文共 1821 字,大约阅读时间需要 6 分钟。

可用的查询设置如下:

参数 描述 举例
conditions Search conditions for the find operation. Is used to extract only those records that fulfill a specified criterion. By default Phalcon\Mvc\Model assumes the first parameter are the conditions. “conditions” => “name LIKE ‘steve%’”
columns Return specific columns instead of the full columns in the model. When using this option an incomplete object is returned “columns” => “id, name”
bind Bind is used together with options, by replacing placeholders and escaping values thus increasing security “bind” => array(“status” => “A”, “type” => “some-time”)
bindTypes When binding parameters, you can use this parameter to define additional casting to the bound parameters increasing even more the security “bindTypes” => array(Column::BIND_TYPE_STR, Column::BIND_TYPE_INT)
order Is used to sort the resultset. Use one or more fields separated by commas. “order” => “name DESC, status”
limit Limit the results of the query to results to certain range “limit” => 10 / “limit” => array(“number” => 10, “offset” => 5)
group Allows to collect data across multiple records and group the results by one or more columns “group” => “name, status”
for_update With this option,  reads the latest available data, setting exclusive locks on each row it reads “for_update” => true
shared_lock With this option,  reads the latest available data, setting shared locks on each row it reads “shared_lock” => true
cache Cache the resultset, reducing the continuous access to the relational system “cache” => array(“lifetime” => 3600, “key” => “my-find-key”)
hydration Sets the hydration strategy to represent each returned record in the result “hydration” => Resultset::HYDRATE_OBJECTS

If you prefer, there is also available a way to create queries in an object-oriented way, instead of using an array of parameters:

转载地址:http://hyxea.baihongyu.com/

你可能感兴趣的文章
站长福利:网站内容设置扫码打赏后才能看啦!
查看>>
温州动车事故中受伤的“我”,还好吗?
查看>>
lvm实现快速备份文件及数据库,lvm快照原理
查看>>
通常,人们会高估自己的学习能力
查看>>
设计模式之Factory Method(工厂方法)
查看>>
10K入职linux运维岗位小伙伴感谢信及面试经历分享
查看>>
Gartner:智能SOC/情报驱动的SOC的五大特征
查看>>
论企业信息化之三:服务和服务管理,价值和价值创造
查看>>
Operations Manager 2007 R2系列之安装部署
查看>>
系统管理员在企业中的职业定位及发展方向 连载(二)
查看>>
【闪存虚拟化】软件定义服务器闪存
查看>>
【沟通的艺术】如何应对棘手的听众?
查看>>
NBU备份时常见错误代码分析及处理
查看>>
Android系统匿名共享内存Ashmem(Anonymous Shared Memory)在进程间共享的原理分析
查看>>
济民可信20亿战略资金助力大健康产业,一号护工建立护工行业标准
查看>>
SQL Server 2008 认证之路
查看>>
ArcGIS制图——多图层道路压盖处理
查看>>
PHP——分页显示数据库内容
查看>>
swift菜鸟入门视频教程-03-字符串和字符
查看>>
linux远程拷贝命令-scp
查看>>