public function find($id, $draft = false)
    {
        if ($draft) {
            $this->setDraftVersionFilter(! $draft);
        }

        $block = $this->getRepository()->find($id);

        if ($draft) {
            if (null !== $revision = $this->revisionManager->getDraftRevision($block)) {
                $this->revisionManager->revert($block, $revision);
            }
        }

        return $block;
    }
public function find($id, $draft = false)
    {
        if ($draft) {
            $this->setDraftVersionFilter(! $draft);
        }

        $block = $this->getRepository()->find($id);

        if ($draft) {
            if (null !== $revision = $this->revisionManager->getDraftRevision($block)) {
                $this->revisionManager->revert($block, $revision);
            }
        }

        return $block;
    }
public function find ( $ id , $ draft = false ) { if ( $ draft ) { $ this -> setDraftVersionFilter ( ! $ draft ) ; } $ block = $ this -> getRepository ( ) -> find ( $ id ) ; if ( $ draft ) { if ( null !== $ revision = $ this -> revisionManager -> getDraftRevision ( $ block ) ) { $ this -> revisionManager -> revert ( $ block , $ revision ) ; } } return $ block ; }
Find a Block in the repository with optional specified version.

@param integer      $id
@param bool         $draft

@return BlockInterface
Find a Block in the repository with optional specified version .