for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace Janisbiz\LightOrm\Dms\MySQL\QueryBuilder\Traits;
use Janisbiz\LightOrm\Dms\MySQL\QueryBuilder\QueryBuilderException;
trait ColumnTrait
{
/**
* @var array
*/
protected $column = [];
* @param array|string $column
* @param boolean $clearAll
*
* @return $this
* @throws QueryBuilderException
public function column($column, bool $clearAll = false)
if (empty($column)) {
throw new QueryBuilderException('You must pass $column to column method!');
}
if (!\is_array($column)) {
$column = [$column];
if ($clearAll == true) {
===
When comparing two booleans, it is generally considered safer to use the strict comparison operator.
$this->column = $column;
} else {
$this->column = \array_merge($this->column, $column);
return $this;
* @return string
protected function buildColumnQueryPart(): string
return empty($this->column) ? '*' : \implode(', ', $this->column);
When comparing two booleans, it is generally considered safer to use the strict comparison operator.