Download the PHP package neonus/db-layer without Composer
On this page you can find all versions of the php package neonus/db-layer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download neonus/db-layer
More information about neonus/db-layer
Files in neonus/db-layer
Download neonus/db-layer
More information about neonus/db-layer
Files in neonus/db-layer
Vendor neonus
Package db-layer
Short Description A custom DBAL-based repository pattern.
License proprietary
Package db-layer
Short Description A custom DBAL-based repository pattern.
License proprietary
Please rate this library. Is it a good library?
Informations about the package db-layer
Neonus DB Layer
A lightweight PHP database abstraction layer built on top of Doctrine DBAL with a repository pattern implementation.
Overview
This package provides a clean, extensible database layer for PHP applications using:
- Doctrine DBAL for database interactions
- Repository Pattern for data access abstraction
- Entity pattern for object-oriented data representation
- Factory pattern for entity creation
Features
- 🔧 BaseRepository - Abstract repository with common database operations
- 🏗️ BaseEntity - Abstract entity class with standard properties and methods
- 📦 EntityFactory - Factory for creating entity instances from data
- 🔌 Extensible interfaces - Easy to implement custom repositories and entities
- ✨ Type-safe operations - Parameter type handling for DBAL
Installation
Requirements
- PHP 7.4+
- Doctrine DBAL ^3.0 or ^4.0
- Symfony Dependency Injection ^8.0
Quick Start
1. Create an Entity
Extend BaseEntity to define your domain model:
2. Create a Repository
Extend BaseRepository to implement data access logic:
3. Use the Repository
API Reference
BaseRepository
Methods
get(int $id): BaseEntity|bool- Fetch a single entity by IDgetByUrl(string $url): BaseEntity|bool- Fetch a single entity by URLpersist(BaseEntity $entity, bool $forceInsert = false): int- Save or update an entitydeleteAll(): int- Delete all records from the tablegetDb(): Connection- Access the DBAL connection directly
BaseEntity
Properties
id- Primary key (auto-managed)created_at- Creation timestamp (DateTime)
Methods
getId(): int- Get the entity IDsetId(int $id): void- Set the entity IDgetCreatedAt(): DateTime- Get creation timestampsetCreatedAt(mixed $created_at): void- Set creation timestamptoArray(): array- Convert entity to array
Project Structure
Changelog
See CHANGELOG.md for a list of changes in each release.
License
Proprietary - NEONUS, s.r.o.
Author
NEONUS, s.r.o. ([email protected])
All versions of db-layer with dependencies
PHP Build Version
Package Version
The package neonus/db-layer contains the following files
Loading the files please wait ...