Add unit test to remove metadata

This commit is contained in:
Frederic Guillot
2015-12-30 16:59:21 +01:00
parent 9039e27b13
commit 65f26699a6
5 changed files with 18 additions and 12 deletions

View File

@@ -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();
}
}