Skip to content

Instantly share code, notes, and snippets.

@slifin
Created January 16, 2014 14:25
Show Gist options
  • Save slifin/8455806 to your computer and use it in GitHub Desktop.
Save slifin/8455806 to your computer and use it in GitHub Desktop.
public $parents = array();
function loadParent($rootID=NULL){
$rootID = $rootID ?: $this->d_rootId;
$parent = $this->findone(['d_id = ?', $rootID]);
$this->parents[] = $parent;
if (!$parent->d_rootId)
return 'test';
else
$this->loadParent($parent->d_rootId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment