.' of "' . $key . '" must be a non-empty string');
}
$result = $this->db->select(['id' => $key]);
- if (count($result)) {
+ if ($result && count($result)) {
return $result->current()->getArrayCopy();
}
return false;
.' of "' . $key . '" must be a non-empty string');
}
$result = $this->db->select(['id' => $key]);
- if (count($result)) {
+ if ($result && count($result)) {
return true;
}
return false;
public function deleteSubscription($key)
{
$result = $this->db->select(['id' => $key]);
- if (count($result)) {
+ if ($result && count($result)) {
$this->db->delete(
['id' => $key]
);