protected function join(
        $type,
        $joinTableName,
        $key,
        $comparator,
        $value = null,
        $shouldCompareFields = true,
        $tableName = null
    ) {
        if (!$tableName) {
            $tableName = $this->getTableName();
        }

        $condition = new \Parable\ORM\Query\Condition();
        $condition
            ->setQuery($this)
            ->setTableName($tableName)
            ->setJoinTableName($joinTableName)
            ->setKey($key)
            ->setComparator($comparator)
            ->setValue($value)
            ->setShouldCompareFields($shouldCompareFields);

        $this->joins[$type][] = $condition;
        return $this;
    }