<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Repository; 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($kkQsP) { $this->keyName = $kkQsP; } public function getCreatedAtColumn() { return 'created_at'; } public function getUpdatedAtColumn() { return 'updated_at'; } public function isSoftDeletes() { return $this->isSoftDeletes; } public function setIsSoftDeletes($voOU3) { $this->isSoftDeletes = $voOU3; } public function add(Form $Pl0Cf) { throw new RuntimeException('This repository does not support "add" method.'); } public function editing(Form $Pl0Cf) { throw new RuntimeException('This repository does not support "editing" method.'); } public function edit(Form $Pl0Cf) { throw new RuntimeException('This repository does not support "edit" method.'); } public function show(Detail $z3x5T) { throw new RuntimeException('This repository does not support "show" method.'); } public function deleting(Form $Pl0Cf) { throw new RuntimeException('This repository does not support "delete" method.'); } public function delete(Form $Pl0Cf, Arrayable $XpVL2) { throw new RuntimeException('This repository does not support "delete" method.'); } public function get(Model $pWRTh) { throw new RuntimeException('This repository does not support "get" method.'); } private $sortColumn = 'sort'; public function getSortColumn() { return $this->sortColumn; } public function setSortColumn($tzAUI) { $this->sortColumn = $tzAUI; } public function sortEdit(Form $Pl0Cf) { 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($tzAUI) { $this->treePidColumn = $tzAUI; } public function getTreeTitleColumn() { return $this->treeTitleColumn; } public function setTreeTitleColumn($tzAUI) { $this->treeTitleColumn = $tzAUI; } public function getTreeSortColumn() { return $this->treeSortColumn; } public function setTreeSortColumn($tzAUI) { $this->treeSortColumn = $tzAUI; } public function getTreeItems() { 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(...$iq6Gr) { return new static(...$iq6Gr); } public static function instance($a_UAg, array $RTmZV = array()) { goto Bk2QC; xoDJf: if ($a_UAg instanceof \Illuminate\Database\Eloquent\Model || $a_UAg instanceof \Illuminate\Database\Eloquent\Builder) { $a_UAg = EloquentRepository::make($a_UAg); } goto pz6HH; BeXFi: return $a_UAg; goto t__vA; eIn02: if (is_string($a_UAg)) { $a_UAg = new $a_UAg($RTmZV); } goto xoDJf; pz6HH: if (!$a_UAg instanceof \ModStart\Repository\Repository) { $StsmC = is_object($a_UAg) ? get_class($a_UAg) : $a_UAg; throw new \InvalidArgumentException("The class [{$StsmC}] must be a type of [" . Repository::class . '].'); } goto BeXFi; Bk2QC: if (null === $a_UAg) { return null; } goto eIn02; t__vA: } }