public function removeObjectById( $contentObjectId, $commit = null )
    {
        if ( !isset( $commit ) && ( $this->iniConfig->variable( 'IndexOptions', 'DisableDeleteCommits' ) === 'true' ) )
        {
            $commit = false;
        }
        elseif ( !isset( $commit ) )
        {
            $commit = true;
        }

        // Indexing is not implemented in eZ Publish 5 legacy search engine
        if ( $this->searchHandler instanceof LegacyHandler )
        {
            $searchEngine = new eZSearchEngine();
            $searchEngine->removeObjectById( $contentObjectId, $commit );

            return true;
        }

        $this->searchHandler->deleteContent( (int)$contentObjectId );

        if ( $commit )
        {
            $this->commit();
        }

        return true;
    }