src/FelixOnline/Base/BaseManager.php
protected function getJoin()
    {
        if (!empty($this->joins)) {
            $joins = array();
            foreach ($this->joins as $join) {
                $manager = $join['manager'];
                $st = array();

                if ($join['type']) {
                    $st[] = $join['type'];
                }

                if ($join['column']) {
                    $column = $join['column'];
                } else {
                    $column = $this->pk;
                }

                if ($join['column_right']) {
                    $column_right = $join['column_right'];
                } else {
                    $column_right = $manager->pk;
                }

                $st[] = "JOIN `" . $manager->table . "`";

                $st[] = "ON (";
                $st[] = "`" . $this->table . "`.`" . $column . "`";
                $st[] = "=";
                $st[] = "`" . $manager->table . "`.`" . $column_right . "`";
                $st[] = ")";
                $joins[] = implode(' ', $st);
                $joins[] = $manager->getJoin();
            }
            return implode("\n", $joins);
        }
        return null;
    }
protected function getJoin()
    {
        if (!empty($this->joins)) {
            $joins = array();
            foreach ($this->joins as $join) {
                $manager = $join['manager'];
                $st = array();

                if ($join['type']) {
                    $st[] = $join['type'];
                }

                if ($join['column']) {
                    $column = $join['column'];
                } else {
                    $column = $this->pk;
                }

                if ($join['column_right']) {
                    $column_right = $join['column_right'];
                } else {
                    $column_right = $manager->pk;
                }

                $st[] = "JOIN `" . $manager->table . "`";

                $st[] = "ON (";
                $st[] = "`" . $this->table . "`.`" . $column . "`";
                $st[] = "=";
                $st[] = "`" . $manager->table . "`.`" . $column_right . "`";
                $st[] = ")";
                $joins[] = implode(' ', $st);
                $joins[] = $manager->getJoin();
            }
            return implode("\n", $joins);
        }
        return null;
    }
Get Join