public function addSoftDelete(ApiInterface $entity, $alias) {
        $reflectionClass = new \ReflectionClass(SoftDelete::class);
        $reflectionMethod = $reflectionClass->getMethod("getOptions");
        $reflectionMethod->setAccessible(true);

        /** @var SoftDelete[] $softDeleteBehaviors */
        $softDeleteBehaviors = $entity->getAllBehaviorsByClassName(SoftDelete::class);

        foreach($softDeleteBehaviors as $softDeleteBehavior) {
            $options = $reflectionMethod->invoke($softDeleteBehavior);
            $sql = $alias . '.' . $options["field"] . '!=?0';
            $params = [$options["value"]];
            $this->getCriteriaHelper()->andWhere($sql, $params);
        }
    }