From 65f26699a63bd05859208092abb5d9ec1429a53f Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Wed, 30 Dec 2015 16:59:21 +0100 Subject: Add unit test to remove metadata --- app/Model/Metadata.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'app/Model') diff --git a/app/Model/Metadata.php b/app/Model/Metadata.php index ae7475c4..690b2265 100644 --- a/app/Model/Metadata.php +++ b/app/Model/Metadata.php @@ -101,21 +101,11 @@ abstract class Metadata extends Base * * @access public * @param integer $entity_id - * @param string $name + * @param string $name * @return bool */ public function remove($entity_id, $name) { - - $this->db->startTransaction(); - - if (! $this->db->table(static::TABLE)->eq($this->getEntityKey(), $entity_id)->eq('name', $name)->remove()) { - $this->db->cancelTransaction(); - return false; - } - - $this->db->closeTransaction(); - - return true; + return $this->db->table(static::TABLE)->eq($this->getEntityKey(), $entity_id)->eq('name', $name)->remove(); } } -- cgit v1.2.3