Download the PHP package jarivas/no-orm without Composer
On this page you can find all versions of the php package jarivas/no-orm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package no-orm
no-orm
A simple and light SQL lib that you were needing it and not knowing
- Generates Entities
- Requires very basic Mysql knowledge
- No obscure code
- Pascal cased getter and setters
- Column names as constants
- Handles relationships automatically
Getting Started
composer require jarivas/no-orm
- $host is the mysql host
- $dbname schema name where read tables to generate helper classes
- $username mysql user
- $password mysql password
- $targetFolder where in the file system you want the files to be located
- $namespace, is a string with a standard php namespace, for example 'Db\Book'
Generating classes
- My recommendation is create php command in order to generate files everytime you want
Examples
- I have been using this db example https://github.com/datacharmer/test_db
- Select the first 1000 rows
$result = Entity\CurrentDeptEmp::get();
- Get the value of the column emp_no of the first row
$result[0]->getEmpNo()
-
Insert
-
Update
- Delete
$result = Entity\Departments::delete($where);
API
- All the generated classes contains
const
s that begins withCOL
that represent that column in the db, exampleCurrentDeptEmp::COL_DEPT_NO
- The where and having syntax are the same across the methods
- Projection means the selected fields from the query
- If you do not specify any projection by default will generate all fields PascalCased instead of snake_cased
emp_no
=>EmpNo
, also will include the ones on the relations - The relations fields will have the upper case table name prefixed
DEPARTMENTS_DeptNo
orEMPLOYEES_BirthDate
- The trait EntityBody will be on each generated class and will be the one who generates and executes the queries
- Those methods are
get
,insertOne
,update
,delete
All versions of no-orm with dependencies
PHP Build Version
Package Version
No informations.
The package jarivas/no-orm contains the following files
Loading the files please wait ....