avasin avasin - 1 year ago 119
PHP Question

Is it possible to specify two limit values(from, offset) in one Phalcon\Mvc\Model::find() method?

For a moment i found following example:

$robots = Robots::find(array("limit" => 100));

Is it possible to define two values for limit, "from" and "offset"?
In Zend Framework it was possible with Db adapter function, that looked like this:

$db->select()->limit($from, $offset)

Answer Source

You could always use PHQL which supports the OFFSET like so (in a controller):

$sql     = 'SELECT * FROM Robots LIMIT 100 OFFSET 10';
$stmt    = $this->modelsManager->createQuery($sql)
$results = $stmt->execute();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download