public function getByElement($cid, $ctype)
{
$data = $this->db->fetchRow("SELECT * FROM edit_lock WHERE cid = ? AND ctype = ?", [$cid, $ctype]);
if (!$data["id"]) {
throw new \Exception("Lock with cid " . $cid . " and ctype " . $ctype . " not found");
}
$this->assignVariablesToModel($data);
// add elements path
$element = Model\Element\Service::getElementById($ctype, $cid);
if ($element) {
$this->model->setCpath($element->getRealFullPath());
}
}