cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

Models - offset does not work

Open nikolasha opened this issue 13 years ago • 6 comments

In version 1.0.1 reappeared bug #504

nikolasha avatar Apr 09 '13 14:04 nikolasha

Can you post a test for this I'm not able to reproduce this problem

ghost avatar Apr 14 '13 04:04 ghost

I checked the various options. Bug appears, if the limit is specified as a string:

Questions::find(
    array( 'limit' => '2,3')
);

In previous versions it worked

nikolasha avatar Apr 14 '13 12:04 nikolasha

Yep, but 2,3 is not a valid limit, you must use:

Questions::find(
    array( 'limit' => array('number' => 2, 'offset' => 3)
);

ghost avatar Apr 14 '13 15:04 ghost

What about backward compatibility? ;)

nikolasha avatar Apr 14 '13 21:04 nikolasha

Maybe the bug was support that syntax :)

ghost avatar Apr 14 '13 22:04 ghost

OK, but the string was more convenient :)

nikolasha avatar Apr 14 '13 22:04 nikolasha