Improve Link::getOppositeLinkId()

This commit is contained in:
Frederic Guillot
2015-05-09 23:00:23 -04:00
parent 1176a489ab
commit 4641d4cf77
2 changed files with 13 additions and 2 deletions

View File

@@ -55,8 +55,7 @@ class Link extends Base
*/
public function getOppositeLinkId($link_id)
{
$link = $this->getById($link_id);
return $link['opposite_id'] ?: $link_id;
return $this->db->table(self::TABLE)->eq('id', $link_id)->findOneColumn('opposite_id') ?: $link_id;
}
/**