Created
September 3, 2011 10:45
-
-
Save renepardon/1190999 to your computer and use it in GitHub Desktop.
ORM or just Zend_Db_Tabble?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$this->_em->setTable('user'); // Sets DbTable-class to use. | |
$users = $this->_em->findById(1); // Returns a collection of users found. | |
$user = $users->first(); // Get only the first user. | |
$user->setFirstname('Max'); | |
$user->setLastname('Mustermann'); | |
$this->_em->save($user); // Update user information. |
rtreffer
commented
Sep 3, 2011
_em->find('Entity_User', 1); // retrieve the user entity
$user->setFirstname('Max')->setLastname('Mustermann'); // a data model is nicer with chaining
$this->_em->flush(); // save all pending changes
Mh, stimmt. Fluent interface und so :)
save() hingegen kann bisher nur eine Änderung speichern. Vorerst müsste das reichen.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment