Download the PHP package patrick-barreto/data-base without Composer
On this page you can find all versions of the php package patrick-barreto/data-base. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download patrick-barreto/data-base
More information about patrick-barreto/data-base
Files in patrick-barreto/data-base
Package data-base
Short Description Basic ORM to manipulate database and make a CRUD at model class very easy
License GPL-3.0-or-later
Informations about the package data-base
About Project
If you dont't have a php environment with a database, you can use this docker environment: https://github.com/PatrickBarreto/baseBackend
The next step of this code is:
- Implement the essentials DDL Commands (CREATE, DROP, TRUNCATE, ALTER)
If you have an idea or pull request to make, do it. Ideas are very welcome.
How to Install
.env
You need to fill your environments variables. If you want make it easy use https://packagist.org/packages/patrick-barreto/dot-env
How to Use
Repository
Use the Crud Instance
Use the Command Instance
Use the Query Class
IMPORTANT: Be carefull, here you controll what will be running. The application won't do nothing but execute the query.
Ressources for DML command Class
It is the same if instance manually or directilly with Crud Instance
Common for all down classes
This method is responsable to check if a table name was seted in the instance of class that heirded this class
This method is responsable to set a table in the instance of class that heirded this class
This method is responsable to set the Where Simple Conditction for the query of instance class that heirded this class
This method is responsable to set the Where In Conditction for the query of instance class that heirded this class
This method is responsable to concat the Inner Join command
This method is responsable to concat the Right Join command
This method is responsable to concat the Left Join command
This method is responsable to concat the Full Join command
This method is responsable to concat the Cross Join command
Select
DataBase\Actions\DML\Commands\Select
Set the distinct option, by default it is false
Set the fields option, by default its '*'
Set the limit option
Set the order option, ASC or DESC
Set the group by option.
Set the having option
Build the query sentense for a Select query
This method id responsable to return data with an associative array
This method is responsable to return data with an object of a class type. By default it is stdClass
Insert
DataBase\Actions\DML\Commands\Insert
Set the ignore option, by default it is false
Set the fields option, by default it is false
Set the values option, by default it is false
Set the values with a SELECT query
Build the query sentense for a Insert query
This method is responsable to run the query of the class without a fetch result.
Update
DataBase\Actions\DML\Commands\Update
This method is responsable for set a SET command for an Update query
Build the query sentense for a Update query
This method is responsable to run the query of the class without a fetch result.
Delete
DataBase\Actions\DML\Commands\Delete
Build the query sentense for a delete query
This method is responsable to run the query of the class without a fetch result.