<?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($CnFib) { $this->keyName = $CnFib; } public function getCreatedAtColumn() { return 'created_at'; } public function getUpdatedAtColumn() { return 'updated_at'; } public function isSoftDeletes() { return $this->isSoftDeletes; } public function setIsSoftDeletes($LUE09) { $this->isSoftDeletes = $LUE09; } public function add(Form $wDk8k) { throw new \RuntimeException('This repository does not support "add" method'); } public function editing(Form $wDk8k) { throw new \RuntimeException('This repository does not support "editing" method'); } public function edit(Form $wDk8k) { throw new \RuntimeException('This repository does not support "edit" method'); } public function show(Detail $dZIpH) { throw new \RuntimeException('This repository does not support "show" method'); } public function deleting(Form $wDk8k) { throw new \RuntimeException('This repository does not support "delete" method'); } public function delete(Form $wDk8k, Arrayable $pGVDE) { throw new \RuntimeException('This repository does not support "delete" method'); } public function get(Model $DRh9Q) { throw new \RuntimeException('This repository does not support "get" method'); } public function getQuery(Model $DRh9Q) { throw new \RuntimeException('This repository dose not support "getQuery" method'); } private $sortColumn = 'sort'; public function getSortColumn() { return $this->sortColumn; } public function setSortColumn($mdHu1) { $this->sortColumn = $mdHu1; } public function sortEdit(Form $wDk8k) { 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($mdHu1) { $this->treePidColumn = $mdHu1; } public function getTreeTitleColumn() { return $this->treeTitleColumn; } public function setTreeTitleColumn($mdHu1) { $this->treeTitleColumn = $mdHu1; } public function getTreeSortColumn() { return $this->treeSortColumn; } public function setTreeSortColumn($mdHu1) { $this->treeSortColumn = $mdHu1; } public function getTreeItems($DEp9z) { 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(...$dUOod) { return new static(...$dUOod); } public static function instance($kEh5R, array $hMgAl = array()) { goto JkgGQ; sHaR3: if (is_string($kEh5R)) { $kEh5R = new $kEh5R($hMgAl); } goto N4Qz2; JkgGQ: if (null === $kEh5R) { return null; } goto sHaR3; oct0d: return $kEh5R; goto mk9EV; pxIfN: if (!$kEh5R instanceof \ModStart\Repository\Repository) { $GgiJ8 = is_object($kEh5R) ? get_class($kEh5R) : $kEh5R; throw new \InvalidArgumentException("The class [{$GgiJ8}] must be a type of [" . Repository::class . '].'); } goto oct0d; N4Qz2: if ($kEh5R instanceof \Illuminate\Database\Eloquent\Model || $kEh5R instanceof \Illuminate\Database\Eloquent\Builder) { $kEh5R = EloquentRepository::make($kEh5R); } goto pxIfN; mk9EV: } }