/** * Makes sure the node to delete is not used as a native target by other nodes. * * @throws Exception if the node to delete is the native target of another node. */ public function delete($key) { $native_refs = $this->select('nid')->filter_by_nativeid($key)->all(\PDO::FETCH_COLUMN); if ($native_refs) { throw new Exception('Node record cannot be deleted because it is used as native source by the following records: \\1', array(implode(', ', $native_refs))); } return parent::delete($key); }