PHPackages                             diogodg/neoorm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. diogodg/neoorm

ActiveLibrary[Database &amp; ORM](/categories/database)

diogodg/neoorm
==============

NeoORM é uma classe para mapeamento de um banco de dados Mysql/Pgsql

v1.3.8(10mo ago)05031MITPHP

Since Oct 25Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/DiogoGraciano/NeoORM)[ Packagist](https://packagist.org/packages/diogodg/neoorm)[ RSS](/packages/diogodg-neoorm/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (40)Used By (1)

NeoORM
======

[](#neoorm)

NeoORM is a PHP library for database mapping that allows you to create and update tables, as well as insert, update, delete, and select records from one or more tables.

Installation
------------

[](#installation)

```
composer require diogodg/neoorm
```

Create a .env file in the root of your project with the following variables:

```
# Database configuration
DRIVER=mysql
DBHOST=localhost
DBPORT=3306
DBNAME=db
DBCHARSET=utf8mb4
DBUSER=root
DBPASSWORD=

# Model path configuration
PATH_MODEL=./app/models
MODEL_NAMESPACE=app\models
```

Examples
--------

[](#examples)

### Selecting Records

[](#selecting-records)

#### Select by ID

[](#select-by-id)

```
// Returns an object with all table columns based on the provided $id
$result = (new Appointment)->get($id);
```

#### Select by Name

[](#select-by-name)

```
// Returns an object with all table columns based on the provided $name
$result = (new Appointment)->get($name, "name");
```

#### Select All Records

[](#select-all-records)

```
// Returns an array of objects with all columns and records from the table
$result = (new Appointment)->getAll();
```

#### Select with Filters

[](#select-with-filters)

```
// Returns an array of objects with all table columns based on the provided filters
$db = new Appointment;
$results = $db->addFilter("start_date", ">=", $start_date)
              ->addFilter("end_date", "
