Skip to content
No description, website, or topics provided.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
README.md
composer.json
console

README.md

#ORM

Installation

  1. Use Composer to download the library
php composer.phar require maps_red/orm dev-master
  1. Then create a file to initiate the ORM config
// config.php
// You need to give the following parameters :
//db_name, db_host, db_user, db_pass, namespace_entity, namespace_repository, 
//dir_entity, dir_repository

require_once(__DIR__."/../vendor/autoload.php");

//Manually 

\Maps_red\Kernel::setDbName($db_name)->setDbHost($db_host)->setDbuser($db_user)
    ->setDbPass($db_pass)->setNamespaceEntity($namespace_entity)
    ->setNamespaceRepository($namespace_repository)
    ->setDirEntity($dir_entity)->setDirRepository($dir_repository);

//From config array

\Maps_red\Kernel::setByArray($parameters);
  1. Extend the console
//console.php
require_once("config.php");
require_once(__DIR__."/../vendor/maps_red/orm/console");
  1. Generate your content
php console.php generator:entity table_name
php console.php generator:repository table_name
or
php console.php generator:both table_name
You can’t perform that action at this time.