summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-11-06 12:15:14 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2019-11-06 12:15:14 +0100
commit109f112131fd13b5b7c7f26bc9413071dad566f1 (patch)
treec4b7b63b5402d6c54e722008b1e5ca7d64a8622d /src
parent416c49ae0b8a0f09da9a3cd96590f5ce6e8b1996 (diff)
BaseModel: Removed methods as already provided by Eloquent Builder
Diffstat (limited to 'src')
-rw-r--r--src/Models/BaseModel.php42
1 files changed, 3 insertions, 39 deletions
diff --git a/src/Models/BaseModel.php b/src/Models/BaseModel.php
index 49255905..6251929c 100644
--- a/src/Models/BaseModel.php
+++ b/src/Models/BaseModel.php
@@ -3,49 +3,13 @@
namespace Engelsystem\Models;
use Illuminate\Database\Eloquent\Builder;
-use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
+/**
+ * @mixin Builder
+ */
abstract class BaseModel extends Model
{
/** @var bool Disable timestamps by default because of "Datensparsamkeit" */
public $timestamps = false;
-
- /**
- * Create a new model
- *
- * @param array $attributes
- * @return BaseModel
- */
- public function create(array $attributes = [])
- {
- $instance = new static($attributes);
- $instance->save();
-
- return $instance;
- }
-
- /**
- * Find a model by its primary key
- *
- * @param mixed $id
- * @param array $columns
- * @return Builder|Builder[]|Collection|static|null
- */
- public static function find($id, $columns = ['*'])
- {
- return static::query()->find($id, $columns);
- }
-
- /**
- * Find a model by its attributes or create a new one
- *
- * @param mixed $id
- * @param array $columns
- * @return static|Model
- */
- public static function findOrNew($id, $columns = ['*'])
- {
- return static::query()->findOrNew($id, $columns);
- }
}