Add unit test to remove metadata
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user