Download the PHP package fishyboat21/extendorm without Composer

On this page you can find all versions of the php package fishyboat21/extendorm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package extendorm

ExtendOrm

[![PHP](https://img.shields.io/badge/PHP-8.4+-777BB4?style=for-the-badge&logo=php&logoColor=white)](https://php.net) [![License](https://img.shields.io/badge/License-MIT-blue?style=for-the-badge)](LICENSE) [![Composer](https://img.shields.io/badge/Composer-fishyboat21/extendorm-blue?style=for-the-badge&logo=composer&logoColor=white)](https://packagist.org/packages/fishyboat21/extendorm) **A Simple, Lightweight CRUD ORM for PHP 8.4+**

📖 Table of Contents


📌 About

ExtendOrm is a lightweight, easy-to-use Object-Relational Mapping (ORM) library for PHP 8.4+. It provides a simple yet powerful way to interact with your database using PHP objects, with support for relationships, query building, and transactions.

Perfect for developers who want ORM functionality without the complexity and overhead of heavier solutions like Doctrine or Eloquent.


✨ Features


📋 Requirements

⚠️ Important Note: For databases other than MySQL (PostgreSQL, SQLite, etc.), you may need to modify the QueryBuilder to handle database-specific SQL syntax (e.g., LIMIT/OFFSET syntax, identifier quoting, date functions, etc.)


🗄️ Database Compatibility

Database Status Notes
MySQL ✅ Fully Supported Tested and recommended
MariaDB ✅ Fully Supported Compatible with MySQL
PostgreSQL ⚠️ Partial Support May require LIMIT/OFFSET syntax changes
SQLite ⚠️ Partial Support May require quote identifier changes
SQL Server ❌ Not Tested Unconfirmed compatibility
Oracle ❌ Not Tested Unconfirmed compatibility

Known MySQL-Specific Syntax

The QueryBuilder currently uses MySQL syntax for the following:

For Other Databases

If you're using PostgreSQL, SQLite, or another database, you may need to adjust:

  1. LIMIT/OFFSET Syntax

  2. Identifier Quoting

  3. Auto-increment Primary Keys

📦 Installation

Via Composer (Recommended)

Manual Installation

  1. Clone the repository:

  2. Include the autoloader in your project:

  3. Or manually load the classes:

⚡ Quick Start


📚 Documentation

Database Connection

Initialize the database connection using the singleton Database class:


Defining Models

Extend the abstract Model class and use PHP attributes to map your database tables:


Attributes

Attribute Description Example
#[Table('name')] Defines the database table name #[Table('users')]
#[Column('field')] Maps property to database column #[Column('user_name')]
#[PrimaryKey] Marks the primary key field #[PrimaryKey] #[Column('id')]
#[Relation(...)] Defines relationships See below

Relationships

ExtendOrm supports three relationship types using the #[Relation] attribute.

RelationType Enum

HasOne Relationship

A user has one profile:

HasMany Relationship

A user has many posts:

BelongsTo Relationship

A post belongs to a user:

Complete Model with Multiple Relationships


CRUD Operations

Create (Insert)

Read (Find)

Update

Delete


Query Builder

Available Operators

Sorting

Building Complex Criteria


Transactions

Execute multiple operations in a transaction with automatic rollback on error:


💡 Examples

Blog System - Complete Example

Advanced Filtering and Pagination


📖 API Reference

Model Class

Method Description Returns
save() Insert or update record based on primary key self
delete() Delete record from database void
FindOne(Criteria $criteria, IQueryBuilder2 $qb) Find single record matching criteria ?static
FindMany(Criteria $criteria, IQueryBuilder2 $qb) Find multiple records matching criteria array
Paging(int $limit, int $offset, Criteria $criteria, QueryBuilder2 $qb) Get paginated results array
GetTableName() Get the table name for the model string

Database Class

Method Description Returns
Boot(PDO $connection) Initialize the ORM with PDO connection void
GetInstance() Get the singleton database instance Database
GetConnection() Get the PDO connection PDO
Transaction(callable $function) Execute operations in a transaction mixed

Criteria Class

Method Description Returns
Add(Criterion $criterion) Add a where condition self
AddSort(Sort $sort) Add sorting order self

QueryBuilderOperator Enum

Value SQL Equivalent
Equals =
NotEqual !=
LessThan <
MoreThan >
LessThanEquals <=
MoreThanEquals >=
Like LIKE
NotLike NOT LIKE
Is IS (for NULL)

QueryBuilderSortType Enum

Value Description
Ascending ORDER BY ... ASC
Descending ORDER BY ... DESC

🗂️ Project Structure


🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

How to Contribute

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Guidelines


📄 License

This project is open-sourced software licensed under the MIT License.


🙏 Acknowledgments


📞 Support


**Made by [FishyBoat21](https://github.com/FishyBoat21)** ⭐ **Star this repo if you find it useful!**

All versions of extendorm with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-pdo Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fishyboat21/extendorm contains the following files

Loading the files please wait ...