PHP Classes

App PHP Model Class: Map object variables to database table records

Recommend this page to a friend!
  Info   View files Example   View files View files (1)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 97 All time: 9,778 This week: 257Up
Version License PHP version Categories
app-model 1.0.1The PHP License5PHP 5, Databases, Design Patterns
Description 

Author

This package provides a class to map object variables to database table records.

A base class performs several operations of models to store and retrieve model variables in a database table.

Applications can create sub-classes to configure specific model objects.

Currently, it can:

- Connect to a given database using a PDO object passed to the class

- Load a model object with a given identifier from the class constructor function

- Create or update model objects by assigning model class variables

- Provide automatic model class variable getter and setter functions

- Find model objects that match a given criteria

- Define relations with other model classes in the model sub-class

- Find related model objects that match a given criteria

- Etc.

Picture of SzpaQ
  Performance   Level  
Name: SzpaQ <contact>
Classes: 5 packages by
Country: Poland Poland
Age: ???
All time rank: 303472 in Poland Poland
Week rank: 179 Up5 in Poland Poland Up

Example

<?php

/**
 *
 * LICENCE
 * ALL RIGHTS RESERVED.
 * YOU ARE NOT ALLOWED TO COPY/EDIT/SHARE/WHATEVER.
 * IN CASE OF ANY PROBLEM CONTACT AUTHOR.
 * @author ?ukasz Szpak (szpaaaaq@gmail.com)
 * @Copyright 2018 SzpaQ
 * @license ALL RIGHTS RESERVED
 *
 * * */

include 'loader.php';
$pdo = new PDO('mysql:dbname=dev_bot;host=localhost;charset=utf8', 'master', '12dsfgNJKGH&34');
App\Model::_setDB($pdo);
App\Model::setPrefix('app_');
$user = new Users(27);

echo
$user->username;
var_dump($user->getContacts(array('order' => 'contact_id DESC')));



/** Create new User */
/* $user = new Users;
    $user->email = "szpaaaaq@gmail.com";
    $user->password = md5('salt_string2357111317192329374357:szpaaaaq@gmail.com');
    $user->username = 'SzpaQ';
    $user->role_id = 1;
    $user->save();
*/
/** find One user */
// Users::findFirst(array('user_id = :uid', 'bind'=>array('uid' => 1)));
   






  Files folder image Files  
File Role Description
Files folder imageexample (1 file)

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file test.php Example Example script

 Version Control Unique User Downloads Download Rankings  
 100%
Total:97
This week:0
All time:9,778
This week:257Up