From 4641d4cf77aac54b1c5688a10e78642b8cda2e87 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 9 May 2015 23:00:23 -0400 Subject: Improve Link::getOppositeLinkId() --- app/Model/Link.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/Model') diff --git a/app/Model/Link.php b/app/Model/Link.php index 87ba49c4..42b8382c 100644 --- a/app/Model/Link.php +++ b/app/Model/Link.php @@ -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; } /** -- cgit v1.2.3