@@ -98,7 +98,7 @@ public static function createCertificate(
9898 /**
9999 * Return status of prepare function availability in shortcut method calls
100100 */
101- protected function isPrepareActive ()
101+ protected function isPrepareOn ()
102102 {
103103 return $ this ->prepareActive ;
104104 }
@@ -144,16 +144,6 @@ public function prepareOff()
144144 $ this ->prepareActive = $ this ->clearPrepare ();
145145 }
146146
147- public function prepareActive ()
148- {
149- $ this ->prepareActive = true ;
150- }
151-
152- public function prepareInActive ()
153- {
154- $ this ->prepareActive = $ this ->clearPrepare ();
155- }
156-
157147 /**
158148 * Convert array to string, and attach '`, `' for separation, if none is provided.
159149 *
@@ -358,7 +348,7 @@ public function where( ...$whereKeyArray)
358348 else
359349 $ myCombineWith = \_AND ;
360350
361- if ($ this ->isPrepareActive ()) {
351+ if ($ this ->isPrepareOn ()) {
362352 $ where .= "$ key " .$ isCondition .' ' .\_TAG ." AND " .\_TAG ." $ myCombineWith " ;
363353 $ this ->addPrepare ($ val );
364354 $ this ->addPrepare ($ combineWith );
@@ -369,7 +359,7 @@ public function where( ...$whereKeyArray)
369359 } elseif ($ isCondition == \_IN ) {
370360 $ value = '' ;
371361 foreach ($ val as $ inValues ) {
372- if ($ this ->isPrepareActive ()) {
362+ if ($ this ->isPrepareOn ()) {
373363 $ value .= \_TAG .', ' ;
374364 $ this ->addPrepare ($ inValues );
375365 } else
@@ -382,7 +372,7 @@ public function where( ...$whereKeyArray)
382372 } elseif ((($ isCondition == \_LIKE ) || ($ isCondition == \_notLIKE)) && ! \preg_match ('/[_%?]/ ' , $ val )) {
383373 return $ this ->clearPrepare ();
384374 } else {
385- if ($ this ->isPrepareActive ()) {
375+ if ($ this ->isPrepareOn ()) {
386376 $ where .= "$ key " .$ isCondition .' ' .\_TAG ." $ combineWith " ;
387377 $ this ->addPrepare ($ val );
388378 } else
@@ -395,7 +385,7 @@ public function where( ...$whereKeyArray)
395385 $ where = \rtrim ($ where , " $ combineWith " );
396386 }
397387
398- if (($ this ->isPrepareActive ()) && !empty ($ this ->prepareValues ()) && ($ where != '1 ' ))
388+ if (($ this ->isPrepareOn ()) && !empty ($ this ->prepareValues ()) && ($ where != '1 ' ))
399389 return " $ whereOrHaving " .$ where .' ' ;
400390
401391 return ($ where != '1 ' ) ? " $ whereOrHaving " .$ where .' ' : ' ' ;
@@ -481,7 +471,7 @@ public function selecting($table ='', $columnFields = '*', ...$conditions)
481471 if (\is_string ($ where )) {
482472 $ sql .= $ where ;
483473 if ($ getSelect_result )
484- return (($ this ->isPrepareActive ()) && !empty ($ this ->prepareValues ()))
474+ return (($ this ->isPrepareOn ()) && !empty ($ this ->prepareValues ()))
485475 ? $ this ->get_results ($ sql , OBJECT , true )
486476 : $ this ->get_results ($ sql );
487477 return $ sql ;
@@ -520,7 +510,7 @@ public function create_select($newTable, $fromColumns, $oldTable = null, ...$fro
520510
521511 $ newTableFromTable = $ this ->select_sql ($ newTable , $ fromColumns , ...$ fromWhere );
522512 if (is_string ($ newTableFromTable ))
523- return (($ this ->isPrepareActive ()) && !empty ($ this ->prepareValues ()))
513+ return (($ this ->isPrepareOn ()) && !empty ($ this ->prepareValues ()))
524514 ? $ this ->query ($ newTableFromTable , true )
525515 : $ this ->query ($ newTableFromTable );
526516
@@ -537,7 +527,7 @@ public function select_into($newTable, $fromColumns, $oldTable = null, ...$fromW
537527
538528 $ newTableFromTable = $ this ->select_sql ($ newTable , $ fromColumns , ...$ fromWhere );
539529 if (is_string ($ newTableFromTable ))
540- return (($ this ->isPrepareActive ()) && !empty ($ this ->prepareValues ()))
530+ return (($ this ->isPrepareOn ()) && !empty ($ this ->prepareValues ()))
541531 ? $ this ->query ($ newTableFromTable , true )
542532 : $ this ->query ($ newTableFromTable );
543533
@@ -558,7 +548,7 @@ public function update($table = '', $keyAndValue, ...$whereKeys)
558548 } elseif (\in_array (\strtolower ($ val ), array ( 'current_timestamp() ' , 'date() ' , 'now() ' ))) {
559549 $ sql .= "$ key = CURRENT_TIMESTAMP(), " ;
560550 } else {
561- if ($ this ->isPrepareActive ()) {
551+ if ($ this ->isPrepareOn ()) {
562552 $ sql .= "$ key = " .\_TAG .", " ;
563553 $ this ->addPrepare ($ val );
564554 } else
@@ -569,7 +559,7 @@ public function update($table = '', $keyAndValue, ...$whereKeys)
569559 $ where = $ this ->where (...$ whereKeys );
570560 if (\is_string ($ where )) {
571561 $ sql = \rtrim ($ sql , ', ' ) . $ where ;
572- return (($ this ->isPrepareActive ()) && !empty ($ this ->prepareValues ()))
562+ return (($ this ->isPrepareOn ()) && !empty ($ this ->prepareValues ()))
573563 ? $ this ->query ($ sql , true )
574564 : $ this ->query ($ sql ) ;
575565 }
@@ -588,7 +578,7 @@ public function delete($table = '', ...$whereKeys)
588578 $ where = $ this ->where (...$ whereKeys );
589579 if (\is_string ($ where )) {
590580 $ sql .= $ where ;
591- return (($ this ->isPrepareActive ()) && !empty ($ this ->prepareValues ()))
581+ return (($ this ->isPrepareOn ()) && !empty ($ this ->prepareValues ()))
592582 ? $ this ->query ($ sql , true )
593583 : $ this ->query ($ sql );
594584 }
@@ -622,7 +612,7 @@ private function _query_insert_replace($table = '', $keyAndValue, $type = '', $e
622612 elseif (\in_array (\strtolower ($ val ), array ( 'current_timestamp() ' , 'date() ' , 'now() ' )))
623613 $ value .= "CURRENT_TIMESTAMP(), " ;
624614 else {
625- if ($ this ->isPrepareActive ()) {
615+ if ($ this ->isPrepareOn ()) {
626616 $ value .= _TAG .", " ;
627617 $ this ->addPrepare ($ val );
628618 } else
@@ -632,7 +622,7 @@ private function _query_insert_replace($table = '', $keyAndValue, $type = '', $e
632622
633623 $ sql .= "( " . \rtrim ($ index , ', ' ) .") VALUES ( " . \rtrim ($ value , ', ' ) ."); " ;
634624
635- if (($ this ->isPrepareActive ()) && !empty ($ this ->prepareValues ()))
625+ if (($ this ->isPrepareOn ()) && !empty ($ this ->prepareValues ()))
636626 $ ok = $ this ->query ($ sql , true );
637627 else
638628 $ ok = $ this ->query ($ sql );
@@ -673,7 +663,7 @@ public function insert_select($toTable = '', $toColumns = '*', $fromTable = null
673663 $ getFromTable = $ this ->select_sql ($ fromTable , $ fromColumns , ...$ fromWhere );
674664
675665 if (\is_string ($ putToTable ) && \is_string ($ getFromTable ))
676- return (($ this ->isPrepareActive ()) && !empty ($ this ->prepareValues ()))
666+ return (($ this ->isPrepareOn ()) && !empty ($ this ->prepareValues ()))
677667 ? $ this ->query ($ putToTable ." " .$ getFromTable , true )
678668 : $ this ->query ($ putToTable ." " .$ getFromTable ) ;
679669
0 commit comments