Download the PHP package seguncodes/smyorm without Composer
On this page you can find all versions of the php package seguncodes/smyorm. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download seguncodes/smyorm
More information about seguncodes/smyorm
Files in seguncodes/smyorm
Package smyorm
Short Description SmyORM is a PHP Object-relational mapping (ORM) that allows developers to write code in simple programming languages of their choice instead of using SQL to access, add, update, and delete data and schemas in the respective database.
License MIT
Informations about the package smyorm
SMYORM
- Description
- Requirements
- Installation
- Usage
- Instantiating the ORM
- Query Builders
- Contributing and Vulnerabilities
- License
DESCRIPTION
SmyORM is a PHP Object-relational mapping (ORM) that allows developers to write code in simple programming languages of their choice instead of using SQL to access, add, update, and delete data and schemas in the respective database. It is currently being used by the SmyPhp framework
REQUIREMENTS
- php 7.3^
- composer
INSTALLATION
USAGE
Instantiating the ORM
Create a Model for each database table eg User.php or Transaction.php; Or a basic file to handle the SQL operations for a specific table. Then instantiate the ORM this way:
User.php
file
Query Builders
The ORM comes with various query builders
save()
The save method saves data into database
User.php
file
findOne()
finds row WHERE argument exists and returns only 1
findOneOrWhere()
This takes in two arguments with the second argument being the OR condition and returns only one result
findAll()
This performs the basic SELECT all functionality
findAllWhere()
This performs the findAll functionality with a WHERE clause
findAllOrWhere()
This performs the findAll functionality with a WHERE clause with the second argument being the OR condition
count()
This counts the number of columns in a table
countWhere()
This counts the number of columns with a WHERE clause
countOrWhere()
This counts the number of columns with a WHERE clause and the second argument being the OR condition
delete()
This takes a WHERE clause and deletes a row or rows
deleteOrWhere()
This takes a WHERE clause and the second argument being the OR condition then deletes corresponding row or rows
update()
This takes two arguments, the data to be updated and the WHERE clause
updateOrWhere()
This takes three arguments, the data to be updated, a WHERE clause and an OR condition
Contributing & Vulnerabilities
If you would like to contribute or you discover a security vulnerability in the SmyORM, your pull requests are welcome. However, for major changes or ideas on how to improve the library, please create an issue.
License
The SmyORM is open-sourced software licensed under the MIT license.