Created
October 9, 2012 09:37
-
-
Save ariefbayu/3857656 to your computer and use it in GitHub Desktop.
get model relations in fuelphp
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
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