psalm-plugin-laravel/stubs/EloquentBuilder.stubphp

351 lines
8.2 KiB
Plaintext

<?php
namespace Illuminate\Database\Eloquent;
use Illuminate\Database\Concerns\BuildsQueries;
use Illuminate\Database\Query\Builder as QueryBuilder;
use Illuminate\Support\Traits\ForwardsCalls;
/**
* @template-covariant TModel of \Illuminate\Database\Eloquent\Model
* @property-read HigherOrderBuilderProxy $orWhere
*
* @mixin \Illuminate\Database\Query\Builder
*/
class Builder
{
use BuildsQueries, Concerns\QueriesRelationships, ForwardsCalls;
/**
* @param \Illuminate\Database\Query\Builder $query
* @return void
*/
public function __construct(QueryBuilder $query) { }
/**
* @param array $attributes
* @return TModel
*/
public function make(array $attributes = []) { }
/**
* @param string $identifier
* @param \Illuminate\Database\Eloquent\Scope|\Closure $scope
* @return self<TModel>
*/
public function withGlobalScope($identifier, $scope) { }
/**
* @param \Illuminate\Database\Eloquent\Scope|string $scope
* @return self<TModel>
*/
public function withoutGlobalScope($scope) { }
/**
* @param array|null $scopes
* @return self<TModel>
*/
public function withoutGlobalScopes(array $scopes = null) { }
/**
* @return array
*/
public function removedScopes() { }
/**
* @param mixed $id
* @return self<TModel>
*/
public function whereKey($id) { }
/**
* @param mixed $id
* @return self<TModel>
*/
public function whereKeyNot($id) { }
/**
* @param string|array|\Closure $column
* @param mixed $operator
* @param mixed $value
* @param string $boolean
* @return self<TModel>
*/
public function where($column, $operator = null, $value = null, $boolean = 'and') { }
/**
* @param \Closure|array|string $column
* @param mixed $operator
* @param mixed $value
* @return self<TModel>
*/
public function orWhere($column, $operator = null, $value = null) { }
/**
* @param string $column
* @return self<TModel>
*/
public function latest($column = null) { }
/**
* @param string $column
* @return self<TModel>
*/
public function oldest($column = null) { }
/**
* @param array $items
* @return \Illuminate\Database\Eloquent\Collection<TModel>
*/
public function hydrate(array $items) { }
/**
* @param string $query
* @param array $bindings
* @return \Illuminate\Database\Eloquent\Collection<TModel>
*/
public function fromQuery($query, $bindings = []) { }
/**
* @template T
* @param T $id
* @param array $columns
* @return (T is array ? \Illuminate\Database\Eloquent\Collection<TModel> : TModel)
*/
public function find($id, $columns = ['*']) { }
/**
* @param \Illuminate\Contracts\Support\Arrayable|array $ids
* @param array $columns
* @return \Illuminate\Database\Eloquent\Collection<TModel>
*/
public function findMany($ids, $columns = ['*']) { }
/**
* @template T
* @param T $id
* @param array $columns
* @return (T is array ? \Illuminate\Database\Eloquent\Collection<TModel> : TModel)
*/
public function findOrFail($id, $columns = ['*']) { }
/**
* @param mixed $id
* @param array $columns
* @return TModel
*/
public function findOrNew($id, $columns = ['*']) { }
/**
* @param array $attributes
* @param array $values
* @return TModel
*/
public function updateOrCreate(array $attributes, array $values = []) { }
/**
* @param array<array-key, string> $columns
* @return TModel
*
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException
*/
public function firstOrFail($columns = ['*']) { }
/**
* @param \Closure|array $columns
* @param \Closure|null $callback
* @return TModel|mixed
*/
public function firstOr($columns = ['*'], Closure $callback = null) { }
/**
* @param string $column
* @return mixed
*/
public function value($column) { }
/**
* @param array $columns
* @return \Illuminate\Database\Eloquent\Collection<TModel>
*/
public function get($columns = ['*']) { }
/**
* @param array $columns
* @return array<array-key, TModel>
*/
public function getModels($columns = ['*']) { }
/**
* @param array $models
* @return array
*/
public function eagerLoadRelations(array $models) { }
/**
* @param string $name
* @return \Illuminate\Database\Eloquent\Relations\Relation
*/
public function getRelation($name) { }
/**
* @return \Generator
*/
public function cursor() { }
/**
* @param int $count
* @param callable $callback
* @param string|null $column
* @param string|null $alias
* @return bool
*/
public function chunkById($count, callable $callback, $column = null, $alias = null) { }
/**
* @return void
*/
protected function enforceOrderBy() { }
/**
* @param string $column
* @param string|null $key
* @return \Illuminate\Support\Collection
*/
public function pluck($column, $key = null) { }
/**
* @param int $perPage
* @param array $columns
* @param string $pageName
* @param int|null $page
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator
*
* @throws \InvalidArgumentException
*/
public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { }
/**
* @param int $perPage
* @param array $columns
* @param string $pageName
* @param int|null $page
* @return \Illuminate\Contracts\Pagination\Paginator
*/
public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { }
/**
* @param array $attributes
* @return TModel
*/
public function create(array $attributes = []) { }
/**
* @param array $attributes
* @return TModel
*/
public function forceCreate(array $attributes) { }
/**
* @param array $values
* @return int
*/
public function update(array $values) { }
/**
* @param string $column
* @param float|int $amount
* @param array $extra
* @return int
*/
public function increment($column, $amount = 1, array $extra = []) { }
/**
* @param string $column
* @param float|int $amount
* @param array $extra
* @return int
*/
public function decrement($column, $amount = 1, array $extra = []) { }
/**
* @return mixed
*/
public function delete() { }
/**
* @return mixed
*/
public function forceDelete() { }
/**
* @param \Closure $callback
* @return void
*/
public function onDelete(Closure $callback) { }
/**
* Call the given local model scopes.
*
* @param array $scopes
* @return self<TModel>
*/
public function scopes(array $scopes) { }
/**
* @return self<TModel>
*/
public function applyScopes() { }
/**
* @param mixed $relations
* @return self<TModel>
*/
public function with($relations) { }
/**
* @param mixed $relations
* @return self<TModel>
*/
public function without($relations) { }
/**
* @param array $attributes
* @return TModel
*/
public function newModelInstance($attributes = []) { }
/**
* @return \Illuminate\Database\Query\Builder
*/
public function getQuery() { }
/**
* @param \Illuminate\Database\Query\Builder $query
* @return self<TModel>
*/
public function setQuery($query) { }
/**
* @param array $eagerLoad
* @return self<TModel>
*/
public function setEagerLoads(array $eagerLoad) { }
/**
* @return TModel
*/
public function getModel() { }
/**
* @param TModel $model
* @return self<TModel>
*/
public function setModel(Model $model) { }
/**
* @return TModel|null
*/
public function first($columns = ['*']) { }
}