<?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($MQulf) { $this->keyName = $MQulf; } public function getCreatedAtColumn() { return 'created_at'; } public function getUpdatedAtColumn() { return 'updated_at'; } public function isSoftDeletes() { return $this->isSoftDeletes; } public function setIsSoftDeletes($MLsLr) { $this->isSoftDeletes = $MLsLr; } public function add(Form $mjvnb) { throw new \RuntimeException('This repository does not support "add" method'); } public function editing(Form $mjvnb) { throw new \RuntimeException('This repository does not support "editing" method'); } public function edit(Form $mjvnb) { throw new \RuntimeException('This repository does not support "edit" method'); } public function show(Detail $lOR1G) { throw new \RuntimeException('This repository does not support "show" method'); } public function deleting(Form $mjvnb) { throw new \RuntimeException('This repository does not support "delete" method'); } public function delete(Form $mjvnb, Arrayable $N0bC4) { throw new \RuntimeException('This repository does not support "delete" method'); } public function get(Model $nzuw7) { throw new \RuntimeException('This repository does not support "get" method'); } public function getQuery(Model $nzuw7) { throw new \RuntimeException('This repository dose not support "getQuery" method'); } private $sortColumn = 'sort'; public function getSortColumn() { return $this->sortColumn; } public function setSortColumn($ib3B9) { $this->sortColumn = $ib3B9; } public function sortEdit(Form $mjvnb) { 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($ib3B9) { $this->treePidColumn = $ib3B9; } public function getTreeTitleColumn() { return $this->treeTitleColumn; } public function setTreeTitleColumn($ib3B9) { $this->treeTitleColumn = $ib3B9; } public function getTreeSortColumn() { return $this->treeSortColumn; } public function setTreeSortColumn($ib3B9) { $this->treeSortColumn = $ib3B9; } public function getTreeItems($a7b0w) { 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(...$DUFkV) { return new static(...$DUFkV); } public static function instance($Qdgwn, array $ilVXN = array()) { goto tnfxU; sNZTx: if ($Qdgwn instanceof \Illuminate\Database\Eloquent\Model || $Qdgwn instanceof \Illuminate\Database\Eloquent\Builder) { $Qdgwn = EloquentRepository::make($Qdgwn); } goto PYeln; tnfxU: if (null === $Qdgwn) { return null; } goto hfFcr; hfFcr: if (is_string($Qdgwn)) { $Qdgwn = new $Qdgwn($ilVXN); } goto sNZTx; PYeln: if (!$Qdgwn instanceof \ModStart\Repository\Repository) { $AEqP7 = is_object($Qdgwn) ? get_class($Qdgwn) : $Qdgwn; throw new \InvalidArgumentException("The class [{$AEqP7}] must be a type of [" . Repository::class . '].'); } goto fkIl3; fkIl3: return $Qdgwn; goto kru5l; kru5l: } }