<?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($aKi50) { $this->keyName = $aKi50; } public function getCreatedAtColumn() { return 'created_at'; } public function getUpdatedAtColumn() { return 'updated_at'; } public function isSoftDeletes() { return $this->isSoftDeletes; } public function setIsSoftDeletes($Vqk9i) { $this->isSoftDeletes = $Vqk9i; } public function add(Form $LEyIF) { throw new \RuntimeException('This repository does not support "add" method'); } public function editing(Form $LEyIF) { throw new \RuntimeException('This repository does not support "editing" method'); } public function edit(Form $LEyIF) { throw new \RuntimeException('This repository does not support "edit" method'); } public function show(Detail $jV5dI) { throw new \RuntimeException('This repository does not support "show" method'); } public function deleting(Form $LEyIF) { throw new \RuntimeException('This repository does not support "delete" method'); } public function delete(Form $LEyIF, Arrayable $G4Y_U) { throw new \RuntimeException('This repository does not support "delete" method'); } public function get(Model $w5oww) { throw new \RuntimeException('This repository does not support "get" method'); } public function getQuery(Model $w5oww) { throw new \RuntimeException('This repository dose not support "getQuery" method'); } private $sortColumn = 'sort'; public function getSortColumn() { return $this->sortColumn; } public function setSortColumn($wvO30) { $this->sortColumn = $wvO30; } public function sortEdit(Form $LEyIF) { 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($wvO30) { $this->treePidColumn = $wvO30; } public function getTreeTitleColumn() { return $this->treeTitleColumn; } public function setTreeTitleColumn($wvO30) { $this->treeTitleColumn = $wvO30; } public function getTreeSortColumn() { return $this->treeSortColumn; } public function setTreeSortColumn($wvO30) { $this->treeSortColumn = $wvO30; } public function getTreeItems($DapY3) { 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(...$Sy_B1) { return new static(...$Sy_B1); } public static function instance($quOXO, array $wyd8_ = array()) { goto AEvHz; ydrcb: return $quOXO; goto c_85s; AEvHz: if (null === $quOXO) { return null; } goto ManjP; JnEtx: if (!$quOXO instanceof \ModStart\Repository\Repository) { $MsA2r = is_object($quOXO) ? get_class($quOXO) : $quOXO; throw new \InvalidArgumentException("The class [{$MsA2r}] must be a type of [" . Repository::class . '].'); } goto ydrcb; zpt7u: if ($quOXO instanceof \Illuminate\Database\Eloquent\Model || $quOXO instanceof \Illuminate\Database\Eloquent\Builder) { $quOXO = EloquentRepository::make($quOXO); } goto JnEtx; ManjP: if (is_string($quOXO)) { $quOXO = new $quOXO($wyd8_); } goto zpt7u; c_85s: } }