File tree Expand file tree Collapse file tree 9 files changed +45
-2
lines changed
Expand file tree Collapse file tree 9 files changed +45
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,12 @@ Use the `from()` method to specify FROM expression.
1010$delete->from('foo');
1111```
1212
13+ Use the ` getTable() ` method to get the table being deleted from.
14+
15+ ``` php
16+ $table = $delete->getTable();
17+ ```
18+
1319### WHERE
1420
1521(All ` WHERE ` methods support [ implicit and sprintf() inline value binding] ( binding.md ) .)
Original file line number Diff line number Diff line change @@ -10,6 +10,12 @@ Use the `into()` method to specify the table to insert into.
1010$insert->into('foo');
1111```
1212
13+ Use the ` getTable() ` method to get the table being inserted into.
14+
15+ ``` php
16+ $table = $insert->getTable();
17+ ```
18+
1319### Columns
1420
1521You can set a named placeholder and its corresponding bound value using the
Original file line number Diff line number Diff line change @@ -10,6 +10,12 @@ Use the `table()` method to specify the table to update.
1010$update->table('foo');
1111```
1212
13+ Use the ` getTable() ` method to get the table being updated.
14+
15+ ``` php
16+ $table = $update->getTable();
17+ ```
18+
1319### Columns
1420
1521You can set a named placeholder and its corresponding bound value using the
Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ public function from(string $table) : static
2525 return $ this ;
2626 }
2727
28+ public function getTable () : string
29+ {
30+ return $ this ->table ;
31+ }
32+
2833 public function getQueryString () : string
2934 {
3035 return $ this ->with ->build ()
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ public function table(string $table) : static
2626 return $ this ;
2727 }
2828
29+ public function getTable () : string
30+ {
31+ return $ this ->table ;
32+ }
33+
2934 public function getQueryString () : string
3035 {
3136 return $ this ->with ->build ()
Original file line number Diff line number Diff line change @@ -48,4 +48,11 @@ public function testCommon()
4848
4949 $ this ->assertBindValues ($ expect , $ this ->statement );
5050 }
51+
52+ public function testGetTable ()
53+ {
54+ $ this ->statement ->from ('t1 ' );
55+ $ actual = $ this ->statement ->getTable ();
56+ $ this ->assertSame ('t1 ' , $ actual );
57+ }
5158}
Original file line number Diff line number Diff line change @@ -54,7 +54,8 @@ public function testCommon()
5454 $ this ->assertBindValues ($ expect , $ this ->statement );
5555 }
5656
57- public function testGetTable (){
57+ public function testGetTable ()
58+ {
5859 $ this ->statement ->into ('t1 ' );
5960 $ actual = $ this ->statement ->getTable ();
6061 $ this ->assertSame ('t1 ' , $ actual );
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ protected function setUp() : void
2828 $ rp ->setAccessible (true );
2929 }
3030
31- $ rp ->setValue (0 );
31+ $ rp ->setValue (null , 0 );
3232 $ this ->statement = $ this ->newStatement ();
3333 }
3434
Original file line number Diff line number Diff line change @@ -104,4 +104,11 @@ public function testHasColumns()
104104 $ this ->statement ->columns (['c1 ' , 'c2 ' ]);
105105 $ this ->assertTrue ($ this ->statement ->hasColumns ());
106106 }
107+
108+ public function testGetTable ()
109+ {
110+ $ this ->statement ->table ('t1 ' );
111+ $ actual = $ this ->statement ->getTable ();
112+ $ this ->assertSame ('t1 ' , $ actual );
113+ }
107114}
You can’t perform that action at this time.
0 commit comments