Installation Last updated: 04/10/2020

install PHPtricks-ORM using Composer.

composer require phptricks/database_class
    "require": {
        "phptricks/database_class": "^5.0"

Whats Included

Once you download the Library, you can see a folder with several files and sub folders. You can read description of some important files.

  • ConfigContains Configuration file & Configuration helper functions file.
    • config_function.phpcontains helper functions.
    • database_config.phpconfigurations file, (database information & library options).
  • LICENSElibrary license under (MIT) license.
  • phptricksCommand manager file
  • phptricksORMMain directory, Contains All Library Classes.
    • Builder.phpTables Builder Class, (DDL Operations is here)
    • CollectionContain Collection Class
      • Collection.phpCollections Class, this class manage all data we retrieves.
    • CommandAll Library Command is here.
      • Alter.phpMigrate ALTER migration.
      • Clear.phpClear cache
      • CommandHelpers.phpContains Some Helpers for Our Commands.
      • ConfigGet Our configuration command.
        • GetConfig.php
      • Create.phpMigrate CREATE migration.
      • Drop.phpMigrate DROP migration.
      • Make.phpGenerate migrations Command.
      • Migrate.phpCommand to migrate all (CREATE, ALTER, DROP)
    • DDLContains All DDL Functionality
      • Alter.phpAlter tables Functionality trait
      • Base.php
      • Create.phpCreate tables Functionality trait
      • Vars.phpcontains variables we need in Builder Class.
    • DMLAll DML Operation is here
      • Delete.phpDelete records Functionality trait
      • Insert.phpinsert into tables Functionality trait
      • Paginate.phpPaginate data Functionality trait
      • Query.phpTrait Contains methods to manage library queries
      • Update.phpEdit & Update records Functionality trait
      • Vars.phpcontains variables we need in Model Class.
    • Database.phpMain Class, its library brain.
    • Model.phpModel Class, to manage DML operations.
    • OperationsQueries Operations.
      • Cond.phpcontains (offset, limit and order-by) operations.
      • Operations.phpcontains count() method.
      • Other.phpContains data-view method.
      • Where.phpWHERE clause manager
      • parseWhere.phpcontains parse-where functionality
    • ProvidersContains supported providers connection methods.
      • Provider.phpconnection class.
    • RelationRelation ship between tables functionality.
      • RelationProvider.php
    • Variables.phpcontains variables we need in Database Class.