public function onDelete(Delete $event)
    {
        if ($this->isDependent()) {
            $class = $this->getRelatedEntity();
            /** @var Entity $entity */
            $entity = new $class();
            $fkField = $this->getForeignKey();
            $pmk = $event->getTarget()->getPrimaryKey();
            $sql = Sql::createSql($entity->getAdapter())
                ->delete($entity->getTableName())
                ->where(
                    ["{$fkField} = :id" => [':id' => $event->getTarget()->$pmk]]
                );

            $sql->execute();
        }
    }