ModelBundle/Repository/WorkflowProfileRepository.php
public function hasTransition(StatusInterface $fromStatus, StatusInterface $toStatus)
    {
        $qa = $this->createAggregationQuery();

        $qa->project(array('transitions' => 1));
        $qa->unwind('$transitions');
        $qa->match(array(
            '$and' => array(
                array('transitions.statusFrom.$id' => new \MongoId($fromStatus->getId())),
                array('transitions.statusTo.$id' => new \MongoId($toStatus->getId())),
        )));

        return $this->countDocumentAggregateQuery($qa) > 0;
    }
public function hasTransition(StatusInterface $fromStatus, StatusInterface $toStatus)
    {
        $qa = $this->createAggregationQuery();

        $qa->project(array('transitions' => 1));
        $qa->unwind('$transitions');
        $qa->match(array(
            '$and' => array(
                array('transitions.statusFrom.$id' => new \MongoId($fromStatus->getId())),
                array('transitions.statusTo.$id' => new \MongoId($toStatus->getId())),
        )));

        return $this->countDocumentAggregateQuery($qa) > 0;
    }
Test is a transition ($fromStatus, $toStatus) exists

@param StatusInterface $fromStatus
@param StatusInterface $toStatus

@return boolean