Skip to content

Instantly share code, notes, and snippets.

@bakertim
Created February 14, 2014 16:32
Show Gist options
  • Save bakertim/9004291 to your computer and use it in GitHub Desktop.
Save bakertim/9004291 to your computer and use it in GitHub Desktop.
PHP: fix Paris missing find_many method
<?php
/**
* Wrap Idiorm's find_many method to return
* an instance of the class associated with
* this wrapper instead of the raw ORM class.
*/
public function find_many() {
$items = parent::find_many();
$result = array();
foreach ($items as $item) {
$result[] = $this->_create_model_instance($item);
}
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment