Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApplicationModel: Join Methodu Genişletilmesi #1

Open
gdemir opened this issue May 24, 2017 · 2 comments
Open

ApplicationModel: Join Methodu Genişletilmesi #1

gdemir opened this issue May 24, 2017 · 2 comments

Comments

@gdemir
Copy link
Member

gdemir commented May 24, 2017

JOIN methodu günlük ihtiyaçları karşılayan sadece INNER parametresiyle çalışmakta bunun LEFT, RIGHT, OUTHER olarak genişletilmesi gerekirse WHERE methoduna bakılarak benzer yapı uygulanması.

İlgili fonksiyon: #L294

@gdemir
Copy link
Member Author

gdemir commented Jun 3, 2017

// Ör. 1:

// Category ["id", "name"]
// Article ["id", "category_id"]
// Like ["id", "article_id"]
// Comment ["id", "article_id"]
// Tag ["id", "comment_id"]

$categories = Category::load()->joins("article")->take();
$categories = Category::load()->joins(["article"])->take();
$categories = Category::load()->joins(["article" => "comment"])->take();
$categories = Category::load()->joins(["article" => ["comment" => ["tag"]]])->take();
$categories = Category::load()->joins(["article" => ["comment" => ["tag"], "like"]])->take();
$categories = Category::load()->joins(["article" => ["comment" => ["tag"], "like"], "document"])->take();
$categories = Category::load()->joins(["article", "document"])->take();

// Ör. 2:

// Department ["id", "name"]
// User ["id", "department_id", "first_name"]
// Address ["id", "user_id", "content"]

$department = Department::load()
->joins(["user", "address"])
->where("User.id", 1)
->select("User.first_name, Department.name, Address.content")
->limit(1)
->take();
print_r($department);

@gdemir gdemir closed this as completed Jun 3, 2017
@gdemir
Copy link
Member Author

gdemir commented Jun 4, 2017

left Right gibi opsiyonlar halen çözülmüş değil

@gdemir gdemir reopened this Jun 4, 2017
@gdemir gdemir changed the title ApplicationModel:Join Methodu Genişletilmesi ApplicationModel: Join Methodu Genişletilmesi Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant