for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of UnderQuery package.
*
* Copyright (c) 2016 Beniamin Jonatan Šimko
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Phuria\UnderQuery\QueryCompiler;
use Phuria\UnderQuery\QueryBuilder\BuilderInterface;
* @author Beniamin Jonatan Šimko <[email protected]>
class CompilerPayload
{
* @var string
private $actualSQL;
* @var BuilderInterface
private $builder;
* @param BuilderInterface $builder
* @param string|null $actualSQL
public function __construct(BuilderInterface $builder, $actualSQL = null)
$this->actualSQL = $actualSQL;
$this->builder = $builder;
}
* @return string
public function getActualSQL()
return $this->actualSQL;
* @return BuilderInterface
public function getBuilder()
return $this->builder;
* @param string $newSQL
* @return CompilerPayload
public function updateSQL($newSQL)
return new CompilerPayload($this->builder, $newSQL);
public function appendSQL($newSQL)
if ($newSQL) {
return $this->updateSQL($this->actualSQL . ' ' . $newSQL);
return $this;