Library/Bullhorn/FastRest/Api/Services/ControllerHelper/Index.php
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);
        }
    }
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);
        }
    }
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 ) ; } }
Add soft delete to the where clause if the entity supports it

@param ApiInterface $entity
@param string $alias

@return void
Add soft delete to the where clause if the entity supports it