<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Repository; use Doctrine\DBAL\Query\QueryBuilder; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Support\Collection; use Illuminate\Support\Traits\Macroable; use ModStart\Detail\Detail; use ModStart\Form\Form; use ModStart\Grid\Model; use ModStart\Support\Concern\HasArguments; abstract class Repository implements RepositoryInterface, SortRepositoryInterface, TreeRepositoryInterface { use Macroable; use HasArguments; protected $keyName = 'id'; protected $isSoftDeletes = false; public function getKeyName() { return $this->keyName ? $this->keyName : 'id'; } public function setKeyName($bZCgI) { $this->keyName = $bZCgI; } public function getCreatedAtColumn() { return 'created_at'; } public function getUpdatedAtColumn() { return 'updated_at'; } public function isSoftDeletes() { return $this->isSoftDeletes; } public function setIsSoftDeletes($MZSBB) { $this->isSoftDeletes = $MZSBB; } public function add(Form $tzSkY) { throw new \RuntimeException('This repository does not support "add" method'); } public function editing(Form $tzSkY) { throw new \RuntimeException('This repository does not support "editing" method'); } public function edit(Form $tzSkY) { throw new \RuntimeException('This repository does not support "edit" method'); } public function show(Detail $eLEQM) { throw new \RuntimeException('This repository does not support "show" method'); } public function deleting(Form $tzSkY) { throw new \RuntimeException('This repository does not support "delete" method'); } public function delete(Form $tzSkY, Arrayable $uQnYG) { throw new \RuntimeException('This repository does not support "delete" method'); } public function get(Model $uV19D) { throw new \RuntimeException('This repository does not support "get" method'); } public function getQuery(Model $uV19D) { throw new \RuntimeException('This repository dose not support "getQuery" method'); } private $sortColumn = 'sort'; public function getSortColumn() { return $this->sortColumn; } public function setSortColumn($gwXrh) { $this->sortColumn = $gwXrh; } public function sortEdit(Form $tzSkY) { throw new RuntimeException('This repository does not support "sortEdit" method.'); } private $treePidColumn = 'pid'; private $treeTitleColumn = 'title'; private $treeSortColumn = 'sort'; public function getTreePidColumn() { return $this->treePidColumn; } public function setTreePidColumn($gwXrh) { $this->treePidColumn = $gwXrh; } public function getTreeTitleColumn() { return $this->treeTitleColumn; } public function setTreeTitleColumn($gwXrh) { $this->treeTitleColumn = $gwXrh; } public function getTreeSortColumn() { return $this->treeSortColumn; } public function setTreeSortColumn($gwXrh) { $this->treeSortColumn = $gwXrh; } public function getTreeItems($KJ9Sf) { throw new \RuntimeException('This repository does not support "getTreeItems" method.'); } public function getTreeAncestorItems() { throw new \RuntimeException('This repository does not support "getTreeAncestorItems" method.'); } public static function make(...$CCHgz) { return new static(...$CCHgz); } public static function instance($WLLL5, array $pdeSd = array()) { goto ErUz_; Kczo9: if ($WLLL5 instanceof \Illuminate\Database\Eloquent\Model || $WLLL5 instanceof \Illuminate\Database\Eloquent\Builder) { $WLLL5 = EloquentRepository::make($WLLL5); } goto Xsh5y; ErUz_: if (null === $WLLL5) { return null; } goto e3Ypr; e3Ypr: if (is_string($WLLL5)) { $WLLL5 = new $WLLL5($pdeSd); } goto Kczo9; Ftkza: return $WLLL5; goto Ikhqc; Xsh5y: if (!$WLLL5 instanceof \ModStart\Repository\Repository) { $cl6c3 = is_object($WLLL5) ? get_class($WLLL5) : $WLLL5; throw new \InvalidArgumentException("The class [{$cl6c3}] must be a type of [" . Repository::class . '].'); } goto Ftkza; Ikhqc: } }