Download the PHP package solophp/repository without Composer
On this page you can find all versions of the php package solophp/repository. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download solophp/repository
More information about solophp/repository
Files in solophp/repository
Package repository
Short Description A flexible base repository class for PHP 8+ with query builder and CRUD operations, featuring immutable architecture and selective loading.
License MIT
Informations about the package repository
Base Repository Class
A flexible base repository class for PHP 8+ with query builder and CRUD operations, featuring immutable architecture and selective loading.
Installation
The package will automatically install required dependencies, including solophp/database.
Features
- Repository pattern with immutable architecture
- Query building with filters, sorting and pagination
- Flexible filtering system:
- Multiple data type support
- Selective loading (JOIN/SELECT)
- Table prefixing
- LIKE queries and raw SQL
- Custom callbacks
- Advanced search functionality with field selection
- Support for transactions
- IDE-friendly with type safety
- Zero config for basic usage
Interface Methods
CRUD and query methods:
Filter Configuration
The FilterConfig class allows you to define complex filters with selective loading:
Implementation Example
Usage Examples
Creating Records
Reading Records
Updating Records
Deleting Records
Using Transactions
Creating Empty Record
Filter Types
The repository supports various placeholder types from solophp/database:
?s
- String (quoted)?i
- Integer?f
- Float?a
- Array (for IN clauses)?A
- Associative array (for SET clauses)?t
- Table name (with prefix)?p
- Raw parameter?d
- Date (DateTimeImmutable)?l
- LIKE parameter (adds '%' for LIKE queries)
Advanced Search Configuration
The new search functionality provides flexible ways to search across multiple fields:
Search features include:
- Multiple field search support
- Field-specific search using
field:value
syntax - Default field fallback (first field in array)
- Word-by-word matching
- Automatic LIKE query generation
Requirements
- PHP ^8.2
- PDO extension
- solophp/database ^2.5
License
MIT