@@ -121,22 +121,7 @@ public function __construct()
121121 */
122122 public function get ($ primary_value )
123123 {
124- $ this ->trigger ('before_get ' );
125-
126- if ($ this ->soft_delete && $ this ->_temporary_with_deleted !== TRUE )
127- {
128- $ this ->_database ->where ($ this ->soft_delete_key , (bool )$ this ->_temporary_only_deleted );
129- }
130-
131- $ row = $ this ->_database ->where ($ this ->primary_key , $ primary_value )
132- ->get ($ this ->_table )
133- ->{$ this ->_return_type ()}();
134- $ this ->_temporary_return_type = $ this ->return_type ;
135-
136- $ row = $ this ->trigger ('after_get ' , $ row );
137-
138- $ this ->_with = array ();
139- return $ row ;
124+ return $ this ->get_by ($ this ->primary_key , $ primary_value );
140125 }
141126
142127 /**
@@ -146,12 +131,13 @@ public function get($primary_value)
146131 public function get_by ()
147132 {
148133 $ where = func_get_args ();
149- $ this ->_set_where ($ where );
150-
134+
151135 if ($ this ->soft_delete && $ this ->_temporary_with_deleted !== TRUE )
152136 {
153137 $ this ->_database ->where ($ this ->soft_delete_key , (bool )$ this ->_temporary_only_deleted );
154138 }
139+
140+ $ this ->_set_where ($ where );
155141
156142 $ this ->trigger ('before_get ' );
157143
@@ -186,13 +172,14 @@ public function get_many($values)
186172 public function get_many_by ()
187173 {
188174 $ where = func_get_args ();
189- $ this ->_set_where ($ where );
190175
191176 if ($ this ->soft_delete && $ this ->_temporary_with_deleted !== TRUE )
192177 {
193178 $ this ->_database ->where ($ this ->soft_delete_key , (bool )$ this ->_temporary_only_deleted );
194179 }
195180
181+ $ this ->_set_where ($ where );
182+
196183 return $ this ->get_all ();
197184 }
198185
0 commit comments