<?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($ZL1Sk) { $this->keyName = $ZL1Sk; } public function getCreatedAtColumn() { return 'created_at'; } public function getUpdatedAtColumn() { return 'updated_at'; } public function isSoftDeletes() { return $this->isSoftDeletes; } public function setIsSoftDeletes($Ksxzw) { $this->isSoftDeletes = $Ksxzw; } public function add(Form $u4AHU) { throw new \RuntimeException('This repository does not support "add" method'); } public function editing(Form $u4AHU) { throw new \RuntimeException('This repository does not support "editing" method'); } public function edit(Form $u4AHU) { throw new \RuntimeException('This repository does not support "edit" method'); } public function show(Detail $jDI3Z) { throw new \RuntimeException('This repository does not support "show" method'); } public function deleting(Form $u4AHU) { throw new \RuntimeException('This repository does not support "delete" method'); } public function delete(Form $u4AHU, Arrayable $aQnJ1) { throw new \RuntimeException('This repository does not support "delete" method'); } public function get(Model $TAWWJ) { throw new \RuntimeException('This repository does not support "get" method'); } public function getQuery(Model $TAWWJ) { throw new \RuntimeException('This repository dose not support "getQuery" method'); } private $sortColumn = 'sort'; public function getSortColumn() { return $this->sortColumn; } public function setSortColumn($FT9zA) { $this->sortColumn = $FT9zA; } public function sortEdit(Form $u4AHU) { 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($FT9zA) { $this->treePidColumn = $FT9zA; } public function getTreeTitleColumn() { return $this->treeTitleColumn; } public function setTreeTitleColumn($FT9zA) { $this->treeTitleColumn = $FT9zA; } public function getTreeSortColumn() { return $this->treeSortColumn; } public function setTreeSortColumn($FT9zA) { $this->treeSortColumn = $FT9zA; } public function getTreeItems($Ds7Jy) { 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(...$psLH5) { return new static(...$psLH5); } public static function instance($lZ6bd, array $neKx3 = array()) { goto MRJlV; jT8Ok: return $lZ6bd; goto Nw4d_; ZaqnR: if ($lZ6bd instanceof \Illuminate\Database\Eloquent\Model || $lZ6bd instanceof \Illuminate\Database\Eloquent\Builder) { $lZ6bd = EloquentRepository::make($lZ6bd); } goto CSMEZ; urQ66: if (is_string($lZ6bd)) { $lZ6bd = new $lZ6bd($neKx3); } goto ZaqnR; CSMEZ: if (!$lZ6bd instanceof \ModStart\Repository\Repository) { $KrsM3 = is_object($lZ6bd) ? get_class($lZ6bd) : $lZ6bd; throw new \InvalidArgumentException("The class [{$KrsM3}] must be a type of [" . Repository::class . '].'); } goto jT8Ok; MRJlV: if (null === $lZ6bd) { return null; } goto urQ66; Nw4d_: } }