public function delete($parameters = [])
    {
        if (!is_array($parameters)) {
            if (func_num_args() !== 1) {
                $parameters = func_get_args();
            }

            $this->deleteByPrimaryKey($parameters);

            return;
        }

        $relations = $this->entity->getRelations();

        if (empty($relations)) {
            $this->manager->postPendingQuery(
                new PendingQuery(
                    $this->entity,
                    PendingQuery::TYPE_UPDATE,
                    $this->applyFilters(
                        $this->queryBuilder->delete($this->entity->getTable())
                    ),
                    $this->parameters
                )
            );
        } else {
            $this->deleteRecords(
                $this->with(array_keys($relations))
                     ->get(array_merge($this->parameters, $parameters))
            );
        }
    }