<?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($AWXu8) { $this->keyName = $AWXu8; } public function getCreatedAtColumn() { return 'created_at'; } public function getUpdatedAtColumn() { return 'updated_at'; } public function isSoftDeletes() { return $this->isSoftDeletes; } public function setIsSoftDeletes($Dk929) { $this->isSoftDeletes = $Dk929; } public function add(Form $aDbJm) { throw new \RuntimeException('This repository does not support "add" method'); } public function editing(Form $aDbJm) { throw new \RuntimeException('This repository does not support "editing" method'); } public function edit(Form $aDbJm) { throw new \RuntimeException('This repository does not support "edit" method'); } public function show(Detail $S8rqk) { throw new \RuntimeException('This repository does not support "show" method'); } public function deleting(Form $aDbJm) { throw new \RuntimeException('This repository does not support "delete" method'); } public function delete(Form $aDbJm, Arrayable $L2PAG) { throw new \RuntimeException('This repository does not support "delete" method'); } public function get(Model $BWo2e) { throw new \RuntimeException('This repository does not support "get" method'); } public function getQuery(Model $BWo2e) { throw new \RuntimeException('This repository dose not support "getQuery" method'); } private $sortColumn = 'sort'; public function getSortColumn() { return $this->sortColumn; } public function setSortColumn($Gttsd) { $this->sortColumn = $Gttsd; } public function sortEdit(Form $aDbJm) { 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($Gttsd) { $this->treePidColumn = $Gttsd; } public function getTreeTitleColumn() { return $this->treeTitleColumn; } public function setTreeTitleColumn($Gttsd) { $this->treeTitleColumn = $Gttsd; } public function getTreeSortColumn() { return $this->treeSortColumn; } public function setTreeSortColumn($Gttsd) { $this->treeSortColumn = $Gttsd; } public function getTreeItems($V12FF) { 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(...$zIOpr) { return new static(...$zIOpr); } public static function instance($pEs5l, array $d9ApU = array()) { goto Wkovo; N8CMw: if (is_string($pEs5l)) { $pEs5l = new $pEs5l($d9ApU); } goto FgJ30; Wkovo: if (null === $pEs5l) { return null; } goto N8CMw; mFVnC: return $pEs5l; goto vh0Ka; BmXd2: if (!$pEs5l instanceof \ModStart\Repository\Repository) { $cTFJ4 = is_object($pEs5l) ? get_class($pEs5l) : $pEs5l; throw new \InvalidArgumentException("The class [{$cTFJ4}] must be a type of [" . Repository::class . '].'); } goto mFVnC; FgJ30: if ($pEs5l instanceof \Illuminate\Database\Eloquent\Model || $pEs5l instanceof \Illuminate\Database\Eloquent\Builder) { $pEs5l = EloquentRepository::make($pEs5l); } goto BmXd2; vh0Ka: } }