module/Customize/src/Grid/Customize/Model/Rule/Mapper.php
public function deleteByRoot( $rootId = null, array $except = array() )
    {
        if ( null === $rootId )
        {
            $where = array( new Predicate\IsNull(
                'rootParagraphId'
            ) );
        }
        else
        {
            $where = array(
                'rootParagraphId' => (int) $rootId,
            );
        }

        if ( ! empty( $except ) )
        {
            $where[] = new Predicate\NotIn( 'id', $except );
        }

        $delete = $this->sql()
                       ->delete()
                       ->where( $where );

        $result = $this->sql()
                       ->prepareStatementForSqlObject( $delete )
                       ->execute();

        return $result->getAffectedRows();
    }
public function deleteByRoot( $rootId = null, array $except = array() )
    {
        if ( null === $rootId )
        {
            $where = array( new Predicate\IsNull(
                'rootParagraphId'
            ) );
        }
        else
        {
            $where = array(
                'rootParagraphId' => (int) $rootId,
            );
        }

        if ( ! empty( $except ) )
        {
            $where[] = new Predicate\NotIn( 'id', $except );
        }

        $delete = $this->sql()
                       ->delete()
                       ->where( $where );

        $result = $this->sql()
                       ->prepareStatementForSqlObject( $delete )
                       ->execute();

        return $result->getAffectedRows();
    }
public function deleteByRoot ( $ rootId = null , array $ except = array ( ) ) { if ( null === $ rootId ) { $ where = array ( new Predicate \ IsNull ( 'rootParagraphId' ) ) ; } else { $ where = array ( 'rootParagraphId' => ( int ) $ rootId , ) ; } if ( ! empty ( $ except ) ) { $ where [ ] = new Predicate \ NotIn ( 'id' , $ except ) ; } $ delete = $ this -> sql ( ) -> delete ( ) -> where ( $ where ) ; $ result = $ this -> sql ( ) -> prepareStatementForSqlObject ( $ delete ) -> execute ( ) ; return $ result -> getAffectedRows ( ) ; }
Delete rules by root-id

@param   int|null    $rootId
@param   int[]       $except
@return  int
Delete rules by root - id