Created
October 3, 2010 15:39
-
-
Save joshtronic/608676 to your computer and use it in GitHub Desktop.
PICKLES Model Example
This file contains hidden or 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 | |
// Pulls the records with ID 1-10 | |
$city = new City(array('conditions' => array('id BETWEEN' => array(1, 10)))); | |
// Loops through the records | |
while ($city->record) | |
{ | |
// Sets the active field to 0 for the current record | |
$city->record['active'] = 0; | |
// Commits the current record (UPDATE) | |
$city->commit(); | |
// Moves to the next record | |
$city->next(); | |
} | |
// @todo Implement $city->commitAll() to avoid doing ->commit() in the loop | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment