@@ -145,8 +145,8 @@ public function close()
145145 */
146146 public function page_limit ($ size = 500 , $ page = 0 )
147147 {
148- if ($ size != 'no_limit ' ) {
149- if ($ page != 0 ) {
148+ if ($ size !== 'no_limit ' ) {
149+ if ($ page !== 0 ) {
150150 if (!$ page || $ page <= 0 || empty ($ page )) {
151151 $ page = 1 ;
152152 }
@@ -338,7 +338,7 @@ public function get_data_simple_result($selectField = '*', $wheres = [], $size =
338338 }
339339 }
340340 // Limit Result
341- self :: _page_limit ($ size , $ page );
341+ $ this -> _page_limit ($ size , $ page );
342342 // Order Result
343343 foreach ($ orderBy as $ key => $ val ) {
344344 $ this ->db ->order_by ($ this ->tableName . '. ' . $ key , $ val );
@@ -369,9 +369,9 @@ public function get_info($value = '', $field = null, $array = false)
369369 }
370370 if ($ array === true ) {
371371 return $ this ->db ->get ()->row_array ();
372- } else {
373- return $ this ->db ->get ()->row ();
374372 }
373+
374+ return $ this ->db ->get ()->row ();
375375 }
376376
377377 /**
@@ -402,12 +402,12 @@ public function get_value($value_input = '', $field_input = null, $field_output
402402 if (null !== $ field_output ) {
403403 if (null === $ query ->row ()) {
404404 return null ;
405- } else {
406- return $ query ->row ()->$ field_output ;
407405 }
408- } else {
409- return $ query ->row ();
406+
407+ return $ query ->row ()-> $ field_output ;
410408 }
409+
410+ return $ query ->row ();
411411 }
412412
413413 /**
@@ -497,16 +497,14 @@ public function request_builder($search)
497497 {
498498 if (!empty ($ search )) {
499499 foreach ($ search as $ field => $ value ) {
500- if ($ this ->db ->field_exists ($ field , $ this ->tableName )) {
501- if (!empty ($ value )) {
502- if (is_array ($ value )) {
503- $ this ->db ->where_in ($ this ->tableName . '. ' . $ field , $ value );
504- } else {
505- $ this ->db ->like ($ this ->tableName . '. ' . $ field , $ value );
506- }
500+ if (!empty ($ value ) && $ this ->db ->field_exists ($ field , $ this ->tableName )) {
501+ if (is_array ($ value )) {
502+ $ this ->db ->where_in ($ this ->tableName . '. ' . $ field , $ value );
503+ } else {
504+ $ this ->db ->like ($ this ->tableName . '. ' . $ field , $ value );
507505 }
508506 }
509- if ($ field == 'sort ' ) {
507+ if ($ field === 'sort ' ) {
510508 $ sort = (strpos ($ value , '- ' ) === false ) ? 'DESC ' : 'ASC ' ;
511509 $ column = (strpos ($ value , '- ' ) === false ) ? $ value : substr ($ value , 1 );
512510 if ($ this ->db ->field_exists ($ column , $ this ->tableName )) {
@@ -522,7 +520,7 @@ public function request_builder($search)
522520 */
523521 public function __destruct ()
524522 {
525- if ($ this ->db != '' ) {
523+ if ($ this ->db ) {
526524 $ this ->close ();
527525 }
528526 }
0 commit comments