37 lines
841 B
PHP
37 lines
841 B
PHP
<?php
|
|
|
|
namespace Ulmus\QueryBuilder;
|
|
|
|
use Ulmus\{Query, QueryBuilder };
|
|
|
|
class MssqlQueryBuilder extends QueryBuilder implements Query\QueryBuilderInterface
|
|
{
|
|
public function limit(int $value) : self
|
|
{
|
|
if ( null === $offset = $this->getFragment(Query\MsSQL\Offset::class) ) {
|
|
$offset = new Query\MsSQL\Offset();
|
|
$this->push($offset);
|
|
}
|
|
|
|
$offset->limit = $value;
|
|
|
|
if ($value === 0) {
|
|
$this->removeFragment(Query\MsSQL\Offset::class);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function offset(int $value) : self
|
|
{
|
|
if ( null === $offset = $this->getFragment(Query\MsSQL\Offset::class) ) {
|
|
$offset = new Query\MsSQL\Offset();
|
|
$this->push($offset);
|
|
}
|
|
|
|
$offset->offset = $value;
|
|
|
|
return $this;
|
|
}
|
|
}
|