File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -166,13 +166,18 @@ public static function create( $columns = [] ) {
166166 * Returns all model with condition
167167 *
168168 * @param string|array $column Column to search in
169- * @param string $value Value to match
169+ * @param string $value Value to match
170170 *
171171 * @throws \Exception
172172 *
173173 * @return array
174174 */
175175 public static function where ( $ column , $ value = '' ) {
176+
177+ if ( is_bool ( $ value ) ) {
178+ $ value = (int ) $ value ;
179+ }
180+
176181 return static ::many_array_to_model (
177182 EE ::db ()
178183 ->table ( static ::$ table )
@@ -245,8 +250,15 @@ public function __unset( $name ) {
245250 * @return bool Model saved successfully
246251 */
247252 public function save () {
253+
248254 $ fields = $ this ->fields ;
249255
256+ foreach ( $ fields as $ key => $ value ) {
257+ if ( is_bool ( $ value ) ) {
258+ $ fields [ $ key ] = (int ) $ value ;
259+ }
260+ }
261+
250262 if ( static ::$ needs_update_timestamp ) {
251263 $ fields = array_merge (
252264 $ fields , [
You can’t perform that action at this time.
0 commit comments