diff options
| author | Murtaza Sultani <sultani@data-quest.de> | 2026-02-26 10:06:19 +0100 |
|---|---|---|
| committer | Murtaza Sultani <sultani@data-quest.de> | 2026-02-26 10:06:19 +0100 |
| commit | 84756b1d41611c7c18df27234d2e7eca6897416e (patch) | |
| tree | 7a56a2c81d776e64156768ce61e69bb05dbb3db6 | |
| parent | 092b8c28c90f014a2e14d01a99bd5c04756ede59 (diff) | |
Remove un related changesissue-6033
| -rw-r--r-- | lib/classes/SimpleORMap.php | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/lib/classes/SimpleORMap.php b/lib/classes/SimpleORMap.php index 6e2f044..9861a1d 100644 --- a/lib/classes/SimpleORMap.php +++ b/lib/classes/SimpleORMap.php @@ -2582,45 +2582,6 @@ abstract class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate self::$mariadb_column_default_fix = $state; } - public static function firstOrCreate(array $attributes, array $values = []): static - { - $whereClauses = []; - foreach ($attributes as $key => $value) { - $whereClauses[] = "$key = :$key"; - } - - $record = static::findOneBySQL(implode(' AND ', $whereClauses), $attributes); - if ($record) { - return $record; - } - - return static::create([ - ...$attributes, - ...$values - ]); - } - - public static function updateOrCreate(array $attributes, array $values = []): static - { - $whereClauses = []; - foreach ($attributes as $key => $value) { - $whereClauses[] = "$key = :$key"; - } - - $record = static::findOneBySQL(implode(' AND ', $whereClauses), $attributes); - - if ($record) { - $record->setData($values); - $record->store(); - return $record; - } - - return static::create([ - ...$attributes, - ...$values - ]); - } - // new query builder: private array $wheres = []; |
