Does the SQL Mapper erase() method skip() to the next record?

31 views
Skip to first unread message

Richard Catto

unread,
Jul 7, 2017, 12:20:29 PM7/7/17
to Fat-Free Framework
I would like to know if I call the erase() method on a mapper object, does it automatically skip() to the next record or do I still have to execute skip() to move the Cursor to the next record?

I looked for info in the docs but this question is not addressed.

ved

unread,
Jul 7, 2017, 12:39:07 PM7/7/17
to Fat-Free Framework
I ran a quick test and it appears that it does not call skip automatically after erase.

There are beforeerase and aftererase event handlers that you can probably leverage if you need that functionality.

xfra35

unread,
Jul 8, 2017, 4:35:30 PM7/8/17
to Fat-Free Framework
That's correct. It used to "skip" automatically but it doesn't anymore. See issue 797 for more details.

Richard Catto

unread,
Jul 8, 2017, 11:39:38 PM7/8/17
to Fat-Free Framework
Thanks for your answer. I had a look at the issue and discovered use of the valid() method of the Cursor class. This is undocumented. I had to read the code to see that is implemented as a synonym of not dry.

function valid() {
  return !$this->dry();
}

Can't you publish the documentation as a wiki, so the community can assist you to document fatfree?

Sample code illustrating usage can be posted in a "user comments" section.
Reply all
Reply to author
Forward
0 new messages