File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55namespace Effectra \SqlQuery \Operations ;
66
7+ use Effectra \SqlQuery \Condition ;
78
89trait OperationsTrait
910{
@@ -17,6 +18,15 @@ public function addQuery(string $query)
1718 $ this ->setAttribute ('query ' , $ query );
1819 }
1920
21+ public function whereConditions (Condition $ conditions ):self
22+ {
23+ $ condition = $ conditions ->getAttributes () ;
24+ foreach ($ condition ['where ' ] as $ attr ) {
25+ $ this ->addToAttribute ('where ' ,$ attr );
26+ }
27+ return $ this ;
28+ }
29+
2030 /**
2131 * Add a WHERE clause to the SQL query.
2232 *
Original file line number Diff line number Diff line change @@ -35,15 +35,6 @@ public function __construct(string $table)
3535 $ this ->setAttribute ('insert_data_mode ' , Insert::INSERT_VALUES_MODE_NORMAL );
3636 }
3737
38- public function whereConditions (Condition $ conditions ):self
39- {
40- $ condition = $ conditions ->getAttributes () ;
41- foreach ($ condition ['where ' ] as $ attr ) {
42- $ this ->addToAttribute ('where ' ,$ attr );
43- }
44- return $ this ;
45- }
46-
4738 /**
4839 * Get the SQL query generated by the Update operation.
4940 *
You can’t perform that action at this time.
0 commit comments