class ProductsController extends \Phalcon\Mvc\Controller
{ public function saveAction()
{ //Obtain the TransactionsManager from the services container
$manager = $this->di->getTransactions(); //Or
$manager = $this->transactions; //Request a transaction
$transaction = $manager->get(); //...
} }

  

使用:

//Find a robot by its name
$robot = Robots::findFirst("theName = 'Voltron'");
echo $robot->theName, "\n"; //Get robots ordered by type
$robot = Robots::find(array('order' => 'theType DESC'));
foreach ($robots as $robot) {
echo 'Code: ', $robot->code, "\n";
} //Create a robot
$robot = new Robots();
$robot->code = '10101';
$robot->theName = 'Bender';
$robot->theType = 'Industrial';
$robot->theYear = 2999;
$robot->save();

  

最新文章

  1. dofile执行ANDROID APK里面的文件
  2. python---sys
  3. SQL基础语法等
  4. 【JavaEE】SSH+Spring Security自定义Security的部分处理策略
  5. Unity2D 背景图铺满与Camera.Size的计算公式
  6. 使用Ext.Net时,配置文件的最简单写法
  7. 除了创建时指定窗口位置之外,还有3种移动窗口位置的办法(移动的同时往往可以改变窗口大小)(SetWindowPos最有用,它有许多标志位)
  8. IIS6.0服务器搭建网站无法访问解决方法
  9. nginx添加需要代理的域名 配置
  10. ER图与UML图
  11. 该View转换成Bitmap方法
  12. peoplesoft function PSTREENODE 通过 deptid 获得部门树 一级部门 名称
  13. JS运动框架的封装过程(一)
  14. [ArcGIS API for JavaScript 4.8] Sample Code-Get Started-popups简介
  15. UOJ #449. 【集训队作业2018】喂鸽子
  16. Object constraint language for code generation from activity models
  17. Linux之定时器与时间管理 【转】
  18. vue.js如何实现点击按钮动态添加li
  19. HtmlUnit
  20. CentOS 7 系统root用户忘记密码的重置方法

热门文章

  1. window下使用mysql,报未定义标识符"SOCKET"
  2. mac本配置python环境
  3. python学习之路-第七天-python面向对象编程简介
  4. [StringUtil ] isEmpty VS isBlank
  5. 吴超老师课程--HBASE的集群安装
  6. Redis——安装
  7. python数据类型及其操作
  8. Python(模块(modue)、包(package))
  9. BZOJ 3689: 异或之
  10. 转换数据库连接池为hikaricp