bizarg/repository 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bizarg/repository

最新稳定版本:2.0.2

Composer 安装命令:

composer require bizarg/repository

包简介

repository

README 文档

README

config/app.php

<?php

use Exception;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;

/**
 * Interface Repository
 * @package Bizarg\Repository\Contract
 */
interface Repository
{
    /**
     * @param Pagination|null $pagination
     * @return LengthAwarePaginator
     */
    public function pagination(Pagination $pagination): LengthAwarePaginator;

    /**
     * @return Collection
     */
    public function collection(): Collection;

    /**
     * @return Model|null
     */
    public function first(): ?Model;

    /**
     * @param int $id
     * @return Model|null
     */
    public function byId(int $id): ?Model;

    /**
     * @param string $value
     * @param string|null $key
     * @return Collection
     */
    public function pluck(string $value, ?string $key = null): Collection;

    /**
     * @return int
     */
    public function count(): int;

    /**
     * @param Model $model
     */
    public function store(Model $model): void;

    /**
     * @param Model $model
     * @throws Exception
     */
    public function delete(Model $model): void;

    /**
     * @param Filter|null $filter
     * @return self
     */
    public function setFilter(?Filter $filter);

    /**
     * @param Order|null $order
     * @return self
     */
    public function setOrder(?Order $order);

    /**
     * @param int $limit
     * @return self
     */
    public function setLimit(int $limit);

    /**
     * @param string $value
     * @param string|null $key
     * @return bool
     */
    public function exists(string $value, ?string $key = null): bool;

    /**
     * @param array $data
     */
    public function updateAll(array $data): void;

    /**
     * @throws Exception
     */
    public function deleteAll(): void;

    /**
     * @return Collection
     * @throws Exception
     */
    public function listIds(): Collection;

    /**
     * @param int $id
     * @return Model|null
     */
    public function findOrFail(int $id): ?Model;
}

统计信息

  • 总下载量: 167
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-04