public function findNextInOrder($ordering, array $where = array(), $entity_name = null, $primary_key_field = null) { try { $predicate = new \Zend\Db\Sql\Where(); $where[] = $predicate->lessThan('entity_ordering', $ordering); $select = $this->getFetchSelect($where, array('ordering ' . $this->ordering), array(), null, $entity_name, $primary_key_field); $select->limit(1); $entity = $this->select($select)->current(); if ($entity) { return $entity; } } catch (\Exception $e) { } return false; }