Completed
Push — master ( bd03b7...2e6f46 )
by Ondřej
03:14
created

RelationRecipe::limit()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
namespace Ivory\Query;
3
4
abstract class RelationRecipe implements IRelationRecipe
5
{
6
    /**
7
     * Creates this recipe limited only to certain number of rows, or starting from a certain row.
8
     *
9
     * @param int|null $limit the number of rows to limit this relation to; <tt>null</tt> means no limit
10
     * @param int $offset the number of leading rows to skip
11
     * @return IRelationRecipe recipe for relation containing at most <tt>$limit</tt> rows, skipping the first
12
     *                           <tt>$offset</tt> rows
13
     */
14
    public function limit($limit, int $offset = 0)
15
    {
16
        return new LimitedRelationRecipe($this, $limit, $offset);
17
    }
18
}
19