-
Notifications
You must be signed in to change notification settings - Fork 0
zavg/Zend_ORM
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ORM generator for Zend Framework Generates ZF ORM file structure from SQL script Author: zavg Version: 0.1 Date: 02.07.2011 Be careful, the current version of ORM code generator is extremely sensitive to the SQL formatof input file even to the tabs and space quantinty. It is actually the greatest weakness of the current code revision which should be fixed as soon as possible. To try the code use User.sql file with the sample input data which also exists in repository. Use this file format as the strict pattern to your input data. Also to start working with ORM you should copy manually php-files with parent classes to your project form /parents directory. Using examples Below there are several code snippets with examples of how the typical CRUD-operations are performed using ORM classes generated by script. Create: $userMapper = new General_Model_UserMapper(); $user = new General_Model_User(); $data = array( 'Login' => 'zavg', 'Email' => 'username@somehost.com', 'Name' => 'zavg', 'Password' => md5("123456") ); $user->setOptions($data); $idUser = $userMapper->save($user); Update: $userMapper = new General_Model_UserMapper(); $user = new General_Model_User(); $data = array( 'idUser' => $idUser, 'Name' => 'ZAVG' ); $user->setOptions($data); $userMapper->save($user); Read: $idUser = 2; $userMapper = new General_Model_UserMapper(); $user = $userMapper->find($idUser); Fetch all: $userMapper = new General_Model_UserMapper(); $users = $userMapper->fetchAll(); Delete: Copy Source | Copy HTML $idUser = 2; $userMapper = new General_Model_UserMapper(); $userMapper->deleteObject($idUser);
About
Zend ORM
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published