A super easy PHP Framework for web development!
https://github.com/exacti/phacil-framework
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
979 B
40 lines
979 B
10 months ago
|
<?php
|
||
|
/**
|
||
|
* Copyright © 2024 ExacTI Technology Solutions. All rights reserved.
|
||
|
* GPLv3 General License.
|
||
|
* https://exacti.com.br
|
||
|
* Phacil PHP Framework - https://github.com/exacti/phacil-framework
|
||
|
*/
|
||
|
|
||
|
namespace Phacil\Framework\MagiQL\Builder\Syntax\Adapt\PostgreSQL;
|
||
|
|
||
|
use Phacil\Framework\MagiQL\Builder\Syntax\SelectWriter as GenericSelectWriter;
|
||
|
use Phacil\Framework\MagiQL\Manipulation\Select;
|
||
|
|
||
|
class SelectWriter extends GenericSelectWriter
|
||
|
{
|
||
|
/**
|
||
|
* @param Select $select
|
||
|
* @param array $parts
|
||
|
*
|
||
|
* @return $this
|
||
|
*/
|
||
|
protected function writeSelectLimit(Select $select, array &$parts)
|
||
|
{
|
||
|
$mask = $this->getStartingLimit($select) . $this->getLimitCount($select);
|
||
|
|
||
|
$limit = '';
|
||
|
|
||
|
if ($mask !== '00') {
|
||
|
$start = $this->placeholderWriter->add($select->getLimitStart());
|
||
|
$count = $this->placeholderWriter->add($select->getLimitCount());
|
||
|
|
||
|
$limit = "LIMIT {$count} OFFSET {$start}";
|
||
|
}
|
||
|
|
||
|
$parts = \array_merge($parts, [$limit]);
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
}
|