eZ\Publish\Core\Persistence\Doctrine\SelectDoctrineQuery::doJoin PHP Method

doJoin() protected method

Helper function to generate join.
protected doJoin ( string $type, array $args ) : eZ\Publish\Core\Persistence\Database\SelectQuery
$type string
$args array
return eZ\Publish\Core\Persistence\Database\SelectQuery
    protected function doJoin($type, array $args)
    {
        if (count($args) === 0) {
            throw new QueryException('No arguments given');
        }
        $tableName = $args[0];
        $condition = '';
        if (count($args) == 2) {
            $condition = $args[1];
        } elseif (count($args) == 3) {
            $condition = $args[1] . ' = ' . $args[2];
        }
        $this->parts['from'][] = array('table' => $tableName, 'type' => $type, 'condition' => $condition);
        return $this;
    }