Download the PHP package mfurman/pdomodel without Composer

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

PDO Model

PDO access class with PDO model - version 1.0.3

Changes from version 1.0.3

Changes from version 1.0.2

Simple Instalation

Just use composer for install new dependency:

Simple Usage

First set config for MySQL database (it can be simple array):

Then initialize singletone instance of PDOAccess by execute static method GET:

At this moment You have one instance of PDO Access class in Your app, You can get this instance whenever You want.

Now You can create simply model by extending dataDb class (this class has state of specific model):

Model example:

When You created models, You can create some repositories. In repositories You have control at database transactions and commits.

Repository example:

Class dataDb has builded methods, which we can use in our model or repository.

Public methods (can be use in model and repository):

Constructor - parametres: (PDOModel-singletone, database_table, commit, flag to register any saves to database in log table)

If You would like to register activity in log table You have to create 'general_log' table (look at the end). If not, just set this toggle to 'false' or do't use it - it's false by default

set_commit - toggle to change auto commit - default by 'true'

reset - reset state of model, it doesn't reset table name

set_table - change or set database table for model (new method)

get_table - return actual database table name set in model (new method)

is - inform about state - is hydrated or not - return 'true/false'

set - set data to model

get - get value by name from model

get_flat - get array of specific data as one dimension array

del - remove some value from state by name

begin - start transaction when autocommit is false

commit - commit started transaction when autocommit is false

Protected methods (can be use in model only):

read - read data from table, hydrate state of model - execute (commit) - return model object, can be chaining

$this->read(table, columns, where, order, limit) :object

insert - insert data to database table - execute (commit) - return new ID of created row

update - update data to existing row in table - execute (commit) - return model object, can be chaining

update_where - update data to existing row in table - execute (commit) - return model object, can be chaining

delete_where - delete data from table - execute (commit) - return model object, can be chaining

exists - check if data exists in database - return true/false

$this->exists(table,['name1' =>'value1', 'name2' => 'value2', ...], where(in SQL), table (optional))

General log table structures

General log table is used when we have set session between user and server. It using session data to recognize existing user and his activity. We have to set two session data for logged user:

General log table must have these specyfic columns and name:

table name: 'general_log'

columns:

All data in general log will be automatically filled when flag 'log_rec' is set to 'true'.

Enjoy.

License :old_key:

Under license (MIT, Apache etc)

MIT © Michał Furman


All versions of pdomodel 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 mfurman/pdomodel contains the following files

Loading the files please wait ....