|
@@ -53,7 +53,7 @@ class Api
|
|
|
public function setRelation($uid, $parent = false, $code = false)
|
|
|
{
|
|
|
if ($code) {
|
|
|
- $parent = $this->getCode($code);
|
|
|
+ $parent = $this->getUid($code);
|
|
|
}
|
|
|
if ($parent <= 0) {
|
|
|
$parent = $this->getSourceUid($uid, false);
|
|
@@ -63,7 +63,7 @@ class Api
|
|
|
}
|
|
|
$relation = new Relation();
|
|
|
$relation->set($parent, $uid);
|
|
|
- return true;
|
|
|
+ return $parent;
|
|
|
}
|
|
|
|
|
|
|