protected function getRefTable(&$refPath) { $refObj = $this->refTable; $refPath = $this->name . '.'; while ($refObj instanceof self) { $refPath .= $refObj->name . '.'; $refObj = $refObj->refTable; } return $refObj; }