Skip to content

Commit b76d209

Browse files
author
Gökhan Demir
authored
Joins dokümantansyon eklendi
1 parent 398693c commit b76d209

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

Diff for: README.md

+26-4
Original file line numberDiff line numberDiff line change
@@ -906,21 +906,43 @@ print_r($user_firstnames);
906906
// Ör. 1:
907907
echo User::load()->count();
908908
// 12
909+
```
909910

910-
911+
```php
911912
// Ör. 2:
912-
913913
echo User::load()->where("first_name", "Gökhan")->count();
914914
// 5
915915
```
916916

917917
> `joins`
918918
919919
```php
920-
// Department ["id", "name"], User ["id", "department_id", "first_name"], "Address" ["id", "user_id", "content"]
920+
// Ör. 1:
921+
922+
// Category ["id", "name"]
923+
// Article ["id", "category_id"]
924+
// Like ["id", "article_id"]
925+
// Comment ["id", "article_id"]
926+
// Tag ["id", "comment_id"]
927+
928+
$categories = Category::load()->joins("article")->take();
929+
$categories = Category::load()->joins(["article"])->take();
930+
$categories = Category::load()->joins(["article" => "comment"])->take();
931+
$categories = Category::load()->joins(["article" => ["comment" => ["tag"]]])->take();
932+
$categories = Category::load()->joins(["article" => ["comment" => ["tag"], "like"]])->take();
933+
$categories = Category::load()->joins(["article" => ["comment" => ["tag"], "like"], "document"])->take();
934+
$categories = Category::load()->joins(["article", "document"])->take();
935+
```
936+
937+
```php
938+
// Ör. 2:
939+
940+
// Department ["id", "name"]
941+
// User ["id", "department_id", "first_name"]
942+
// Address ["id", "user_id", "content"]
921943

922944
$department = Department::load()
923-
->joins(["User", "Address"])
945+
->joins(["user", "address"])
924946
->where("User.id", 1)
925947
->select("User.first_name, Department.name, Address.content")
926948
->limit(1)

0 commit comments

Comments
 (0)