How can I get the number of affected rows after create, update or delete using ORM for Kohana? I checked the main class but don’t return that value…
If there any possible solution to do this, please let me know. If it is possible not use the Query Builder, i prefer use only the ORM class.
Thank you.
Due to its Cascading Filesystem it’s very easy in Kohana to make some changes in system or module classes.
In your case you need to redefine methods of
ORMmodule main class. Its file is located in/modules/orm/classes/kohana/orm.php.Create new
ORMmodule main class file in/application/classes/orm.phpand redefinecreate,updateanddeletemethods so these methods to return the number of affected rows.For example new
updatemethod should end with this: