Skip to content

Commit b41fb52

Browse files
committed
fix typo in ORM data saving code example
1 parent 0d560e1 commit b41fb52

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/app/orm/query/query.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ <h4>Ordering Data</h4>
8383
->toArray();
8484
</code></pre>
8585
<p>
86-
And this one will be compiled then executed in SQL like this:
86+
And this one will be compiled then executed in SQL as following:
8787
</p>
8888
<pre><code class="language-sql">SELECT * FROM Blog.Post ORDER BY Date DESC, Title DESC;</code></pre>
8989
<br>
@@ -96,7 +96,7 @@ <h4>Partitioning Data</h4>
9696
</p>
9797
<pre><code class="language-php">$posts = $blog->Posts->skip(5)->take(10)->toArray();</code></pre>
9898
<p>
99-
Which will be executed in SQL like this:
99+
Which will be compiled then executed in SQL like this:
100100
</p>
101101
<pre><code class="language-sql">SELECT * FROM Blog.Post LIMIT 5,10;</code></pre>
102102
<br>
@@ -122,7 +122,7 @@ <h4>Complex Query</h4>
122122
->toArray();
123123
</code></pre>
124124
<p>
125-
Which will be compiled then executed in SQL like this:
125+
And that will be compiled then executed in SQL like this:
126126
</p>
127127
<pre><code class="language-sql">SELECT * FROM Blog.Post WHERE Date = '2023-01-01' AND Likes > 200 ORDER BY Title LIMIT 10;</code></pre>
128128
<blockquote class="alert alert-info">

src/app/orm/save/save.component.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ <h3>Adding Data</h3>
2626
$post->Date = new DateTime("now");
2727

2828
$blog = new BlogContext();
29-
$blog->Post->add($post);
30-
$blog->Post->save();
29+
$blog->Posts->add($post);
30+
$blog->save();
3131
</code></pre>
3232
<br>
3333
<h3>Deleting Data</h3>
@@ -39,8 +39,8 @@ <h3>Deleting Data</h3>
3939
use Application\Models\BlogContext;
4040

4141
$blog = new BlogContext();
42-
$post = $blog->Post->find(1);
43-
$blog->Post->remove($post);
42+
$post = $blog->Posts->find(1);
43+
$blog->Posts->remove($post);
4444
$blog->save();
4545
</code></pre>
4646
<br>
@@ -53,7 +53,7 @@ <h3>Updating Data</h3>
5353
use Application\Models\BlogContext;
5454

5555
$blog = new BlogContext();
56-
$post = $blog->Post->find(1);
56+
$post = $blog->Posts->find(1);
5757
$post->Content = "Updated content";
5858
$blog->save();
5959
</code></pre>
@@ -75,18 +75,18 @@ <h3>Multiple Operations</h3>
7575
$post->Title = "Post Title";
7676
$post->Content = "Some content...";
7777
$post->Date = new DateTime("now");
78-
$blog->Post->add($post);
78+
$blog->Posts->add($post);
7979

8080
// Deletes post with id = 2
81-
$post = $blog->Post->find(2);
82-
$blog->Post->remove($post);
81+
$post = $blog->Posts->find(2);
82+
$blog->Posts->remove($post);
8383

8484
// Updates post with id = 1
85-
$post = $blog->Post->find(1);
85+
$post = $blog->Posts->find(1);
8686
$post->Content = "Updated content";
8787

8888
// Persists all the operations
89-
$blog->Post->save();
89+
$blog->save();
9090
</code></pre>
9191
</article>
9292
<nav class="no-print" aria-label="Page navigation">

0 commit comments

Comments
 (0)