This repository was archived by the owner on Aug 13, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Deimos \Database ;
4+
5+ trait Instruction
6+ {
7+ public function query ()
8+ {
9+ $ query = $ this ;
10+
11+ return $ this ->database ->transaction ()->call (function ($ database ) use ($ query )
12+ {
13+ /**
14+ * @var Database $database
15+ */
16+ return $ database
17+ ->queryInstruction ($ query )
18+ ->rowCount ();
19+ });
20+ }
21+ }
Original file line number Diff line number Diff line change 44
55use Deimos \Database \Database ;
66use Deimos \QueryBuilder \Instruction ;
7- use Deimos \QueryBuilder \QueryBuilder ;
87
8+ /**
9+ * Class Delete
10+ *
11+ * @package Deimos\Database\Queries
12+ *
13+ * @method int delete()
14+ */
915class Delete extends Instruction \Delete
1016{
1117
18+ use \Deimos \Database \Instruction
19+ {
20+ query as delete;
21+ }
22+
1223 /**
1324 * @var Database
1425 */
@@ -25,22 +36,4 @@ public function __construct(Database $database)
2536 $ this ->database = $ database ;
2637 }
2738
28- /**
29- * @return int
30- */
31- public function delete ()
32- {
33- $ query = $ this ;
34-
35- return $ this ->database ->transaction ()->call (function ($ database ) use ($ query )
36- {
37- /**
38- * @var Database $database
39- */
40- return $ database
41- ->queryInstruction ($ query )
42- ->rowCount ();
43- });
44- }
45-
4639}
Original file line number Diff line number Diff line change 55use Deimos \Database \Connection ;
66use Deimos \Database \Database ;
77use Deimos \QueryBuilder \Instruction \Select ;
8- use Deimos \QueryBuilder \QueryBuilder ;
98
109class Query extends Select
1110{
Original file line number Diff line number Diff line change 44
55use Deimos \Database \Database ;
66use Deimos \QueryBuilder \Instruction ;
7- use Deimos \QueryBuilder \QueryBuilder ;
87
8+ /**
9+ * Class Update
10+ *
11+ * @package Deimos\Database\Queries
12+ *
13+ * @method int update()
14+ */
915class Update extends Instruction \Update
1016{
1117
18+ use \Deimos \Database \Instruction {
19+ query as update;
20+ }
21+
1222 /**
1323 * @var Database
1424 */
@@ -25,22 +35,4 @@ public function __construct(Database $database)
2535 $ this ->database = $ database ;
2636 }
2737
28- /**
29- * @return int
30- */
31- public function update ()
32- {
33- $ query = $ this ;
34-
35- return $ this ->database ->transaction ()->call (function ($ database ) use ($ query )
36- {
37- /**
38- * @var Database $database
39- */
40- return $ database
41- ->queryInstruction ($ query )
42- ->rowCount ();
43- });
44- }
45-
4638}
You can’t perform that action at this time.
0 commit comments