@@ -218,7 +218,7 @@ public static function registerAnnotations()
218
218
*
219
219
* @param array $options The lists of options
220
220
*
221
- * @throws LightQLException
221
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
222
222
*/
223
223
public function __construct (array $ options = null )
224
224
{
@@ -381,7 +381,7 @@ public function close(): void
381
381
/**
382
382
* Connect to the database / Instantiate PDO
383
383
*
384
- * @throws LightQLException When the connexion fails.
384
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException When the connexion fails.
385
385
*
386
386
* @return void
387
387
*/
@@ -414,7 +414,7 @@ public function getQueryString(): string
414
414
*
415
415
* @param string $table The table's name
416
416
*
417
- * @return LightQL
417
+ * @return \ElementaryFramework\LightQL\ LightQL
418
418
*/
419
419
public function from (string $ table ): LightQL
420
420
{
@@ -427,7 +427,7 @@ public function from(string $table): LightQL
427
427
*
428
428
* @param string|array $condition SQL condition in valid format
429
429
*
430
- * @return LightQL
430
+ * @return \ElementaryFramework\LightQL\ LightQL
431
431
*/
432
432
public function where ($ condition ): LightQL
433
433
{
@@ -466,7 +466,7 @@ public function where($condition): LightQL
466
466
* @param string $column The column to sort.
467
467
* @param string $mode The sort mode.
468
468
*
469
- * @return LightQL
469
+ * @return \ElementaryFramework\LightQL\ LightQL
470
470
*/
471
471
public function order (string $ column , string $ mode = "ASC " ): LightQL
472
472
{
@@ -480,7 +480,7 @@ public function order(string $column, string $mode = "ASC"): LightQL
480
480
* @param int $offset The limit offset.
481
481
* @param int $count The number of elements after the offset.
482
482
*
483
- * @return LightQL
483
+ * @return \ElementaryFramework\LightQL\ LightQL
484
484
*/
485
485
public function limit (int $ offset , int $ count ): LightQL
486
486
{
@@ -493,7 +493,7 @@ public function limit(int $offset, int $count): LightQL
493
493
*
494
494
* @param string $column The column used to group results.
495
495
*
496
- * @return LightQL
496
+ * @return \ElementaryFramework\LightQL\ LightQL
497
497
*/
498
498
public function groupBy (string $ column ): LightQL
499
499
{
@@ -504,7 +504,7 @@ public function groupBy(string $column): LightQL
504
504
/**
505
505
* Add a distinct clause.
506
506
*
507
- * @return LightQL
507
+ * @return \ElementaryFramework\LightQL\ LightQL
508
508
*/
509
509
public function distinct (): LightQL
510
510
{
@@ -518,7 +518,7 @@ public function distinct(): LightQL
518
518
* @param mixed $columns The fields to select. This value can be an array of fields,
519
519
* or a string of fields (according to the SELECT SQL query syntax).
520
520
*
521
- * @throws LightQLException
521
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
522
522
*
523
523
* @return \PDOStatement
524
524
*/
@@ -533,7 +533,7 @@ public function select($columns = "*"): \PDOStatement
533
533
* @param mixed $columns The fields to select. This value can be an array of fields,
534
534
* or a string of fields (according to the SELECT SQL query syntax).
535
535
*
536
- * @throws LightQLException
536
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
537
537
*
538
538
* @return \PDOStatement
539
539
*/
@@ -591,7 +591,7 @@ public function prepare(string $query, array $options = array()): \PDOStatement
591
591
}
592
592
593
593
/**
594
- * Reset all clauses
594
+ * Reset all clauses.
595
595
*/
596
596
protected function resetClauses ()
597
597
{
@@ -608,7 +608,7 @@ protected function resetClauses()
608
608
* @param mixed $columns The fields to select. This value can be an array of fields,
609
609
* or a string of fields (according to the SELECT SQL query syntax).
610
610
*
611
- * @throws LightQLException
611
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
612
612
*
613
613
* @return array
614
614
*/
@@ -629,7 +629,7 @@ public function selectFirst($columns = "*")
629
629
* @param mixed $columns The fields to select. This value can be an array of fields,
630
630
* or a string of fields (according to the SELECT SQL query syntax).
631
631
*
632
- * @throws LightQLException
632
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
633
633
*
634
634
* @return array
635
635
*/
@@ -651,7 +651,7 @@ public function selectArray($columns = "*"): array
651
651
* @param mixed $columns The fields to select. This value can be an array of fields,
652
652
* or a string of fields (according to the SELECT SQL query syntax).
653
653
*
654
- * @throws LightQLException
654
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
655
655
*
656
656
* @return array
657
657
*/
@@ -674,7 +674,7 @@ public function selectObject($columns = "*"): array
674
674
* or a string of fields (according to the SELECT SQL query syntax).
675
675
* @param mixed $params The information used for JOIN.
676
676
*
677
- * @throws LightQLException
677
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
678
678
*
679
679
* @return \PDOStatement
680
680
*/
@@ -690,7 +690,7 @@ public function join($columns, $params): \PDOStatement
690
690
* or a string of fields (according to the SELECT SQL query syntax).
691
691
* @param string|array $params The information used for JOIN.
692
692
*
693
- * @throws LightQLException
693
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
694
694
*
695
695
* @return \PDOStatement
696
696
*/
@@ -735,7 +735,7 @@ private function _join($columns, $params): \PDOStatement
735
735
* or a string of fields (according to the SELECT SQL query syntax).
736
736
* @param mixed $params The information used for JOIN.
737
737
*
738
- * @throws LightQLException
738
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
739
739
*
740
740
* @return array
741
741
*/
@@ -758,7 +758,7 @@ public function joinArray($columns, $params): array
758
758
* or a string of fields (according to the SELECT SQL query syntax).
759
759
* @param mixed $params The information used for JOIN.
760
760
*
761
- * @throws LightQLException
761
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
762
762
*
763
763
* @return array
764
764
*/
@@ -780,7 +780,7 @@ public function joinObject($columns, $params): array
780
780
* @param string|array $columns The fields to select. This value can be an array of fields,
781
781
* or a string of fields (according to the SELECT SQL query syntax).
782
782
*
783
- * @throws LightQLException
783
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
784
784
*
785
785
* @return int|array
786
786
*/
@@ -798,7 +798,7 @@ public function count($columns = "*")
798
798
if (null === $ this ->_group ) {
799
799
$ this ->resetClauses ();
800
800
$ data = $ getFieldsData ->fetch ();
801
- return (int )$ data ['lightql_count ' ];
801
+ return (int ) $ data ['lightql_count ' ];
802
802
}
803
803
804
804
$ this ->resetClauses ();
@@ -819,7 +819,7 @@ public function count($columns = "*")
819
819
*
820
820
* @param array $fieldsAndValues The fields and the associated values to insert.
821
821
*
822
- * @throws LightQLException
822
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
823
823
*
824
824
* @return boolean
825
825
*/
@@ -855,7 +855,7 @@ public function insert(array $fieldsAndValues): bool
855
855
* @param array $values The array of list of values to insert
856
856
* into the specified fields.
857
857
*
858
- * @throws LightQLException
858
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
859
859
*
860
860
* @return boolean
861
861
*/
@@ -885,7 +885,7 @@ public function insertMany(array $columns, array $values): bool
885
885
*
886
886
* @param array $fieldsAndValues The fields and the associated values to update.
887
887
*
888
- * @throws LightQLException
888
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
889
889
*
890
890
* @return boolean
891
891
*/
@@ -919,7 +919,7 @@ public function update(array $fieldsAndValues): bool
919
919
/**
920
920
* Deletes data in table.
921
921
*
922
- * @throws LightQLException
922
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
923
923
*
924
924
* @return boolean
925
925
*/
@@ -940,7 +940,7 @@ public function delete(): bool
940
940
/**
941
941
* Truncates a table.
942
942
*
943
- * @throws LightQLException
943
+ * @throws \ElementaryFramework\LightQL\Exceptions\ LightQLException
944
944
*
945
945
* @return boolean
946
946
*/
@@ -964,9 +964,9 @@ public function truncate(): bool
964
964
* @param string $query The query to execute
965
965
* @param int $mode The fetch mode
966
966
*
967
- * @return \PDOStatement
968
967
* @uses \PDO::query()
969
968
*
969
+ * @return \PDOStatement
970
970
*/
971
971
public function query (string $ query , int $ mode = \PDO ::FETCH_LAZY ): \PDOStatement
972
972
{
@@ -977,6 +977,8 @@ public function query(string $query, int $mode = \PDO::FETCH_LAZY): \PDOStatemen
977
977
* Gets the last inserted id by an
978
978
* INSERT query.
979
979
*
980
+ * @uses \PDO::lastInsertId()
981
+ *
980
982
* @return int
981
983
*/
982
984
public function lastInsertID (): int
@@ -998,16 +1000,37 @@ public function quote($value): string
998
1000
return $ this ->_pdo ->quote ($ value );
999
1001
}
1000
1002
1003
+ /**
1004
+ * Disable auto commit mode and start a transaction.
1005
+ *
1006
+ * @uses \PDO::beginTransaction()
1007
+ *
1008
+ * @return bool
1009
+ */
1001
1010
public function beginTransaction (): bool
1002
1011
{
1003
1012
return $ this ->_pdo ->beginTransaction ();
1004
1013
}
1005
1014
1015
+ /**
1016
+ * Commit changes made during a transaction.
1017
+ *
1018
+ * @uses \PDO::commit()
1019
+ *
1020
+ * @return bool
1021
+ */
1006
1022
public function commit (): bool
1007
1023
{
1008
1024
return $ this ->_pdo ->commit ();
1009
1025
}
1010
1026
1027
+ /**
1028
+ * Rollback changes made during a transaction.
1029
+ *
1030
+ * @uses \PDO::rollBack()
1031
+ *
1032
+ * @return bool
1033
+ */
1011
1034
public function rollback (): bool
1012
1035
{
1013
1036
return $ this ->_pdo ->rollBack ();
0 commit comments