<?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($eAE99) { $this->keyName = $eAE99; } public function getCreatedAtColumn() { return 'created_at'; } public function getUpdatedAtColumn() { return 'updated_at'; } public function isSoftDeletes() { return $this->isSoftDeletes; } public function setIsSoftDeletes($LMqMK) { $this->isSoftDeletes = $LMqMK; } public function add(Form $SKFwZ) { throw new \RuntimeException('This repository does not support "add" method'); } public function editing(Form $SKFwZ) { throw new \RuntimeException('This repository does not support "editing" method'); } public function edit(Form $SKFwZ) { throw new \RuntimeException('This repository does not support "edit" method'); } public function show(Detail $DdILw) { throw new \RuntimeException('This repository does not support "show" method'); } public function deleting(Form $SKFwZ) { throw new \RuntimeException('This repository does not support "delete" method'); } public function delete(Form $SKFwZ, Arrayable $iB19S) { throw new \RuntimeException('This repository does not support "delete" method'); } public function get(Model $vn_cr) { throw new \RuntimeException('This repository does not support "get" method'); } public function getQuery(Model $vn_cr) { throw new \RuntimeException('This repository dose not support "getQuery" method'); } private $sortColumn = 'sort'; public function getSortColumn() { return $this->sortColumn; } public function setSortColumn($Mczr_) { $this->sortColumn = $Mczr_; } public function sortEdit(Form $SKFwZ) { 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($Mczr_) { $this->treePidColumn = $Mczr_; } public function getTreeTitleColumn() { return $this->treeTitleColumn; } public function setTreeTitleColumn($Mczr_) { $this->treeTitleColumn = $Mczr_; } public function getTreeSortColumn() { return $this->treeSortColumn; } public function setTreeSortColumn($Mczr_) { $this->treeSortColumn = $Mczr_; } public function getTreeItems($Olcky) { 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(...$foKec) { return new static(...$foKec); } public static function instance($w7Oqz, array $v10GK = array()) { goto vCrDi; nHHWX: return $w7Oqz; goto x013N; vCrDi: if (null === $w7Oqz) { return null; } goto q846I; S0VAL: if ($w7Oqz instanceof \Illuminate\Database\Eloquent\Model || $w7Oqz instanceof \Illuminate\Database\Eloquent\Builder) { $w7Oqz = EloquentRepository::make($w7Oqz); } goto qmMHK; q846I: if (is_string($w7Oqz)) { $w7Oqz = new $w7Oqz($v10GK); } goto S0VAL; qmMHK: if (!$w7Oqz instanceof \ModStart\Repository\Repository) { $ogfq7 = is_object($w7Oqz) ? get_class($w7Oqz) : $w7Oqz; throw new \InvalidArgumentException("The class [{$ogfq7}] must be a type of [" . Repository::class . '].'); } goto nHHWX; x013N: } }