<?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($WoS8y) { $this->keyName = $WoS8y; } public function getCreatedAtColumn() { return 'created_at'; } public function getUpdatedAtColumn() { return 'updated_at'; } public function isSoftDeletes() { return $this->isSoftDeletes; } public function setIsSoftDeletes($eVj_F) { $this->isSoftDeletes = $eVj_F; } public function add(Form $dBWZm) { throw new \RuntimeException('This repository does not support "add" method'); } public function editing(Form $dBWZm) { throw new \RuntimeException('This repository does not support "editing" method'); } public function edit(Form $dBWZm) { throw new \RuntimeException('This repository does not support "edit" method'); } public function show(Detail $MSE_o) { throw new \RuntimeException('This repository does not support "show" method'); } public function deleting(Form $dBWZm) { throw new \RuntimeException('This repository does not support "delete" method'); } public function delete(Form $dBWZm, Arrayable $T6ikz) { throw new \RuntimeException('This repository does not support "delete" method'); } public function get(Model $GMqtO) { throw new \RuntimeException('This repository does not support "get" method'); } public function getQuery(Model $GMqtO) { throw new \RuntimeException('This repository dose not support "getQuery" method'); } private $sortColumn = 'sort'; public function getSortColumn() { return $this->sortColumn; } public function setSortColumn($cBDsM) { $this->sortColumn = $cBDsM; } public function sortEdit(Form $dBWZm) { 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($cBDsM) { $this->treePidColumn = $cBDsM; } public function getTreeTitleColumn() { return $this->treeTitleColumn; } public function setTreeTitleColumn($cBDsM) { $this->treeTitleColumn = $cBDsM; } public function getTreeSortColumn() { return $this->treeSortColumn; } public function setTreeSortColumn($cBDsM) { $this->treeSortColumn = $cBDsM; } public function getTreeItems($bG17v) { 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(...$sgeM_) { return new static(...$sgeM_); } public static function instance($UgPp_, array $WdGpR = array()) { goto wIigR; wIigR: if (null === $UgPp_) { return null; } goto wrUq9; I1iQR: return $UgPp_; goto i5VN0; ZKEaJ: if (!$UgPp_ instanceof \ModStart\Repository\Repository) { $t7pan = is_object($UgPp_) ? get_class($UgPp_) : $UgPp_; throw new \InvalidArgumentException("The class [{$t7pan}] must be a type of [" . Repository::class . '].'); } goto I1iQR; EDCDQ: if ($UgPp_ instanceof \Illuminate\Database\Eloquent\Model || $UgPp_ instanceof \Illuminate\Database\Eloquent\Builder) { $UgPp_ = EloquentRepository::make($UgPp_); } goto ZKEaJ; wrUq9: if (is_string($UgPp_)) { $UgPp_ = new $UgPp_($WdGpR); } goto EDCDQ; i5VN0: } }