Download the PHP package miladm/orm without Composer

On this page you can find all versions of the php package miladm/orm. 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 orm

Database (table) introduction

This hook takes care of everything you need with database and currently it works with MySQL database. With the use of PDO communication, it will lower the threat of SQL-injection to almost zero.

Configuration and Installation

create

For each table you have to create a Class extends from Table class.

there are abstract methods you have to config as below

method description
connection here we register the database connection and configurations
tableName the name of current table in string

setup actions before using the table

there's a method called init to setup actions before using this table;

Connection Class

here's the structure of creating connection and to assign a table to a connection

NOTE: by default the key name is id so if it's the same with your table key name you don't have to set it.

set default Key

you can change 'id' as you wish and your database structure is.

Query

To create the query you need to create a function of your table then create the query.

query methods

method parameters description
trace state(boolean) will return the query string and won't run query just to trace
safeMode state(boolean)
query query:string, data?:optional you can run query directly into table
insert data:array insert data into table
where condition: string\array set condition for current query (update or delete)
delete delete current query (condition required)
select columnList:array\string selects from table
count returns number of results
orderDesc column:string\array setup desc order
order column:string\array, asc?:boolean setup order of current query
group column:string acts as group by query
having condition: string\array acts as having query
limit count:int, startPoint?:int make limitation for query and you can do pagination
fetchArray fetch the results as array
checkIfFetchArray returns boolean if we are expecting array
fetchObject fetch results as object
checkIfFetchObject return boolean if we are expecting object as result
name return this table name
as name:string set a secondary name for table as alias
coverName name:string works the same as as method
join table:Table, mapping?:array join this table to other table returns Table object with join
leftJoin table:Table, mapping?:array left join table to other table returns Table object with leftjoin
init_join table:Table, mapping?:array do join effect current object
init_leftJoin table:Table, mapping?:array do left join effect current object
getRelation return relation object of current object

Results data object

If you fetch data as object there will be some features assigned to result data object.

update data

you can update data of current result and call ->save() on results data object and update will happen on database.

note

documentation is in progress but code talks itself. checkout the code for more.


All versions of orm with dependencies

PHP Build Version
Package Version
No informations.
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 miladm/orm contains the following files

Loading the files please wait ....