Data Structures | |
class | zOrm_base |
class | orm_CodeGen |
orm_CodeGen Class Parses the the orm Map on .orm.map.php file from /projects/prjName/etc/conf.d and generates the classes on /projects/prjName/apps/model/orm More... | |
class | zOrm_core |
class | OrmDriver |
class | OrmDriver_mysql |
class | zOrm_magic |
class | zOrm_inc |
class | zOrm_noMagic |
Functions | |
load_orm_map ($mapName, $projectName) | |
load_orm_map() will accept the ormMapName and projectName parse the orm Map from /projects/projectName/etc/conf.d/ormMapName.orm.map.php generate the class on /projects/projectName/apps/model/orm/ormMapName.orm.php and then include that generated class file and returns the tableAlias className(s) as an numarically indexed array | |
Variables | |
$__zigmoyd__Orm_drv = new stdClass() | |
$__ZigOrm = new stdClass() | |
Initializes the ORM Module gets Included for Initialization of ORM Module by the /etc/init.d initialization Script. | |
$__ZigOrm | connections = array() |
$__ZigOrm | dataDict = new stdClass() |
$__ZigOrm dataDict | tables = array() |
Copyright (C) 2008 Neel Basu (Sunanda Bose)
Zigmoyd PHP Framework is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Zigmoyd PHP Framework is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with Zigmoyd PHP Framework. If not, see <http://www.gnu.org/licenses/>.
Database Abstraction Layers.
Copyright (C) 2008 Neel Basu (Sunanda Bose)
Zigmoyd PHP Framework is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Zigmoyd PHP Framework is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with Zigmoyd PHP Framework. If not, see <http://www.gnu.org/licenses/>.
Database Abstraction Layers.
Copyright (C) 2008 Neel Basu (Sunanda Bose)
Zigmoyd PHP Framework is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Zigmoyd PHP Framework is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with Zigmoyd PHP Framework. If not, see <http://www.gnu.org/licenses/>.
Database Abstraction Layers While Using Static ORM Maps database access is done through Database Abstraction Layers or ORM Classes. An ORM Class is a Database abstraction Layer that isolets SQL Queries by writting/generating it on the fly, with a set of easy and user-friendly methods for full CRUD(Create, read, update, delete) Operation that are linked through Models with the controller(action Logic). ORM Classes need not to be written from scratch.they are automatically generated by reading ORM Maps. ORM Maps are textual, Highly Human readable configuration files that Manages different tables and links a connection against them. Zigmoyd Parses those ORM Maps (Configuration Files) and generates the ORM Classes. Although the ORM Classes are auto generated, they <s>can be</s> meant to be edited if required.to handle Custom access methods, addign triggers etc.....
ORM Maps are stored into etc/conf.d Directory with orm.map.php
extension. Although ORM Maps are textual, Human readable configuration Files you dont need to bother about writting a configuration file from scratch. zigmoyd have Command line tools for that automatically too. However its worth to know the structure of that file cause without knowing that you cant edit that file maually.
connection as dataConn{ } table std as Student{ readonly std_id as Id{ } writable std_name as Name{ required: Student's Name Must not be left Blank string: Student's Name Must be a String } } table std_score as Marks{ readonly id as Id{ } writable student_id as StudentId{ required: StudentId Must not be left Blank int: StudentId Must be an Integer } writable subject as Sub{ required: Subject Must not be left Blank string: Subject Name must be a valid string } writable marks as Marks{ optional: __NULL__ default: 0 int: Marks Obtained by the Student Must be an Integer } }Zigmoyd has the ability to read your database and generate the ORM Maps. however it can be edited and tuned for better experience.
driver = "mysql" database = "school" host = "localhost" user = "root" psw = "123456"as the connection parameter is separated in another file more than one orm map can use the same Connection file.
ormMapName.orm.php
in apps/model/orm
directory in your Project's Directory.and one file is created per ORM Map basis. so if the above mentioned ORM Map's name is studentOrm.orm.map.php
ORM Classes for this Map will be created in a file Called studentOrm.orm.php
which will be stored in projects/home/apps/model/orm
Directory. and now the question is what will they contain. In studentOrm.orm.php there will be two Classes.load_orm_map | ( | $ | mapName, | |
$ | projectName | |||
) |
load_orm_map() will accept the ormMapName and projectName parse the orm Map from /projects/projectName/etc/conf.d/ormMapName.orm.map.php generate the class on /projects/projectName/apps/model/orm/ormMapName.orm.php and then include that generated class file and returns the tableAlias className(s) as an numarically indexed array
$map_path | string |
Definition at line 149 of file class-gen.php.
Referenced by zigController::loadOrm().
00149 { 00150 $hwnd = new orm_CodeGen($mapName, $projectName); 00151 $hwnd->gen_class(); 00152 return $hwnd->getClassList(); 00153 }
$__zigmoyd__Orm_drv = new stdClass() |
Definition at line 87 of file module/orm/core.php.
$__ZigOrm = new stdClass() |
Initializes the ORM Module gets Included for Initialization of ORM Module by the /etc/init.d initialization Script.
Definition at line 30 of file lib/module/orm/init.php.
Referenced by zQuery::__construct(), OrmDriver_mysql::__generate(), zDynOrm::colList(), zDbAccess::colList(), zOrm_noMagic::crossJoin(), zOrm_noMagic::forceJoin(), orm_CodeGen::gen_class(), zOrm_core::getFk(), zigController::getLoadedTables(), zOrm_core::init(), zOrm_noMagic::join(), OrmDriver_mysql::listCols(), and zigController::loadOrm().
$__ZigOrm connections = array() |
Definition at line 31 of file lib/module/orm/init.php.
Referenced by zQuery::__construct(), zDynOrm::colList(), and zDbAccess::colList().
$__ZigOrm dataDict = new stdClass() |
Definition at line 32 of file lib/module/orm/init.php.
Referenced by zOrm_noMagic::crossJoin(), zOrm_noMagic::forceJoin(), zOrm_core::getFk(), and zigController::getLoadedTables().
Definition at line 33 of file lib/module/orm/init.php.