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\Language\Expression;
use Phuria\UnderQuery\Table\TableInterface;
* @author Beniamin Jonatan Šimko <[email protected]>
class RelativeClause
{
const RELATIVE_DIRECTIVE = '@.';
const SELF_DIRECTIVE = '@self.';
* @var TableInterface
private $relatedTable;
* @var string
private $clause;
* @param TableInterface $relatedTo
* @param string $clause
* @param string $directive
public function __construct(TableInterface $relatedTo, $clause, $directive)
$this->relatedTable = $relatedTo;
$this->clause = $clause;
$this->directive = $directive;
directive
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
* @return string
public function __toString()
return $this->relatedTable->getQueryBuilder()->toReference($this);
* @return TableInterface
public function getRelatedTable()
return $this->relatedTable;
public function getClause()
return $this->clause;
public function getDirective()
return $this->directive;
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: