Download the PHP package molovo/interrogate without Composer
On this page you can find all versions of the php package molovo/interrogate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package interrogate
Interrogate
Interrogate is a lightweight, standalone Object Relational Mapping (ORM) for PHP 5.5+.
Installing
Copy the included .env.example
file from vendor/molovo/interrogate
to your web server's DOCUMENT_ROOT
, and rename it to .env
. Then, update the new .env
file with your database connection information.
Getting Started
Queries are built using chained methods, which try to follow SQL grammar as much as possible. Queries return a Collection
object containing multiple Model
objects.
Using Joins
Queries with joins can be built by passing another Query
object to the join()
method. The models returned by the joined query are stored in a property on the model, using the table name (or alias if defined). The joined query can compare fields on the parent query with dot syntax, using either the table name (or alias) directly, or the keyword parent
as below.
Using Models
Model classes can created for tables to allow for quick query creation, and adding functionality on a per-table basis. The simplest form of a model is shown below:
By default, the table name is the pluralized snake_cased equivalent of the class name. E.g. the model UserDetail
refers to a table user_details
. To use a different table name, define the static property $tableName
.
Models make use of magic methods to allow static access to methods in the Query class.
You can also statically call methods on the Collection
class.
All versions of interrogate with dependencies
vlucas/phpdotenv Version 2.1.*
jdorn/sql-formatter Version 1.2.*
molovo/str Version ^0.1
molovo/object Version ^1.0