Skip to content

Instantly share code, notes, and snippets.

@ariefbayu
Created October 9, 2012 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ariefbayu/3857656 to your computer and use it in GitHub Desktop.
Save ariefbayu/3857656 to your computer and use it in GitHub Desktop.
get model relations in fuelphp
class Model_CatalogImage extends Orm\Model {
public static function getRelations() {
$return = array();
if(isset(Model_CatalogImage::$_belongs_to)){
$return['belongto'] = Model_CatalogImage::$_belongs_to;
}
if(isset(Model_CatalogImage::$_has_many)){
$return['hasmany'] = Model_CatalogImage::$_has_many;
}
return $return;
}
}
//anywhere you need it, just call:
Model_CatalogImage::getRelations()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment