src/Server/Resource/DoctrineResource.php
/**
     * Delete a list of entities
     *
     * @param mixed $data
     * @return ApiProblem|mixed
     */
Delete a list of entities
@param mixed $data
@return ApiProblem|mixed
Delete a list of entities @param mixed $data @return ApiProblem|mixed
public function deleteList($data)
    {
        $results = $this->triggerDoctrineEvent(DoctrineResourceEvent::EVENT_DELETE_LIST_PRE, $data, $data);
        if ($results->last() instanceof ApiProblem) {
            return $results->last();
        }
        $this->getObjectManager()->getConnection()->beginTransaction();
        foreach ($data as $row) {
            $result = $this->delete($row[$this->getEntityIdentifierName()]);
            if ($result instanceof ApiProblem) {
                $this->getObjectManager()->getConnection()->rollback();
                return $result;
            }
        }
        $this->getObjectManager()->getConnection()->commit();
        $results = $this->triggerDoctrineEvent(DoctrineResourceEvent::EVENT_DELETE_LIST_POST, true, $data);
        if ($results->last() instanceof ApiProblem) {
            return $results->last();
        }
        return true;
    }
public function deleteList ( $ data ) { $ results = $ this -> triggerDoctrineEvent ( DoctrineResourceEvent :: EVENT_DELETE_LIST_PRE , $ data , $ data ) ; if ( $ results -> last ( ) instanceof ApiProblem ) { return $ results -> last ( ) ; } $ this -> getObjectManager ( ) -> getConnection ( ) -> beginTransaction ( ) ; foreach ( $ data as $ row ) { $ result = $ this -> delete ( $ row [ $ this -> getEntityIdentifierName ( ) ] ) ; if ( $ result instanceof ApiProblem ) { $ this -> getObjectManager ( ) -> getConnection ( ) -> rollback ( ) ; return $ result ; } } $ this -> getObjectManager ( ) -> getConnection ( ) -> commit ( ) ; $ results = $ this -> triggerDoctrineEvent ( DoctrineResourceEvent :: EVENT_DELETE_LIST_POST , true , $ data ) ; if ( $ results -> last ( ) instanceof ApiProblem ) { return $ results -> last ( ) ; } return true ; }
Delete a list of entities
 @param mixed $data
 @return ApiProblem|mixed
Delete a list of entities @param mixed $data @return ApiProblem|mixed