Skip to content

Commit e5ba7c7

Browse files
committed
update
1 parent e6d9510 commit e5ba7c7

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/Orm.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@
55
class Orm
66
{
77
/**
8-
<<<<<<< HEAD
98
* Inserts a new record into the specified table.
109
*
1110
* @param string $tableName The name of the table to insert into.
1211
* @param array<string, ?string> $object An associative array representing the record to insert, where keys are column names and values are the corresponding values.
1312
* @return int The ID of the newly inserted record. If no fields are provided, returns 0.
14-
=======
15-
* @param array<string, string|float|int|null> $object
16-
>>>>>>> 3e10fdba060fae137fb789bbd64b8ab69aee0c41
1713
*/
1814
public static function insert(string $tableName, array $object): int
1915
{
@@ -35,17 +31,13 @@ public static function insert(string $tableName, array $object): int
3531
}
3632

3733
/**
38-
<<<<<<< HEAD
3934
* Updates an existing record in the specified table by its ID.
4035
*
4136
* @param string $tableName The name of the table to update.
4237
* @param array<string, ?string> $object An associative array representing the record to insert, where keys are column names and values are the corresponding values.
4338
* @param string|int $id The ID of the record to update.
4439
* @param string $idField The name of the ID field (default is 'id').
4540
* @return bool Returns true if the update was successful, false otherwise.
46-
=======
47-
* @param array<string, string|float|int|null> $object
48-
>>>>>>> 3e10fdba060fae137fb789bbd64b8ab69aee0c41
4941
*/
5042
public static function update(string $tableName, array $object, string|int $id, string $idField = 'id'): bool
5143
{
@@ -73,16 +65,12 @@ public static function update(string $tableName, array $object, string|int $id,
7365
}
7466

7567
/**
76-
<<<<<<< HEAD
7768
* Selects a record from the specified table by its ID.
7869
*
7970
* @param string $tableName The name of the table to select from.
8071
* @param string|int $id The ID of the record to select.
8172
* @param string $idField The name of the ID field (default is 'id').
8273
* @return array<string, ?string> $object An associative array representing the selected record, where keys are column names and values are the corresponding values. If no record is found, an empty array is returned.
83-
=======
84-
* @return array<string, string|float|int|null>
85-
>>>>>>> 3e10fdba060fae137fb789bbd64b8ab69aee0c41
8674
*/
8775
public static function select(string $tableName, string|int $id, string $idField = 'id'): array
8876
{
@@ -103,10 +91,4 @@ public static function delete(string $tableName, string|int $id, string $idField
10391
$sql = "DELETE FROM `$tableName` WHERE `$idField` = ?";
10492
return DB::delete($sql, $id) ? true : false;
10593
}
106-
107-
public static function delete(string $tableName, string|int $id, string $idField = 'id'): int
108-
{
109-
$sql = "DELETE FROM `$tableName` WHERE `$idField` = ?";
110-
return DB::delete($sql, [$id]);
111-
}
11294
}

0 commit comments

Comments
 (0)