From 223a0850dbd34c892acb21bd6686480d8baa9207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ms=C2=B7xl?= Date: Thu, 12 Nov 2020 00:18:32 +0800 Subject: [PATCH] 3 --- Database/ActiveRecord.php | 65 --------------------------------------- 1 file changed, 65 deletions(-) diff --git a/Database/ActiveRecord.php b/Database/ActiveRecord.php index f1edfc2d..2e8c49a4 100644 --- a/Database/ActiveRecord.php +++ b/Database/ActiveRecord.php @@ -42,53 +42,6 @@ class ActiveRecord extends BaseActiveRecord return []; } - /** - * @param string $column - * @param int $value - * @return static|bool - * @throws Exception - */ - public function incrBy(string $column, int $value) - { - if (!$this->mathematics(self::INCR, [$column => $value])) { - return false; - } - $this->{$column} += $value; - return $this->refresh(); - } - - /** - * @param $column - * @param $value - * @return array|Command|bool|int|string - * @throws Exception - */ - public function decrBy(string $column, int $value) - { - if (!$this->mathematics(self::DECR, [$column => $value])) { - return false; - } - $this->{$column} -= $value; - return $this->refresh(); - } - - /** - * @param array $attributes - * @return bool|self - * @throws Exception - */ - public function batchIncrColumn(array $attributes) - { - if (!$this->mathematics(self::INCR, $attributes)) { - return false; - } - foreach ($attributes as $key => $attribute) { - $this->$key += $attribute; - } - return $this; - } - - /** * @param string $column * @param int $value @@ -154,24 +107,6 @@ class ActiveRecord extends BaseActiveRecord return $this; } - - /** - * @param array $attributes - * @return bool|self - * @throws Exception - */ - public function batchDescColumn(array $attributes) - { - if (!$this->mathematics(self::DECR, $attributes)) { - return false; - } - foreach ($attributes as $key => $attribute) { - $this->$key -= $attribute; - } - return $this; - } - - /** * @param $attributes * @param $condition