Model/PageManager.php
public function validateUniqueForceUrlPublish(Page $page, Constraint $constraint)
    {

        if ($page->getForcedUrl() == null) {
            return true;
        }

        $em = $this->getDoctrine()->getManager();
        $pagePublishConflictList = $em->getRepository('KitpagesCmsBundle:PagePublish')->findBy(array('forcedUrl' => $page->getForcedUrl()));
        // there is no conflictual user
        if (empty($pagePublishConflictList)) {
            return true;
        }

        foreach ($pagePublishConflictList as $pagePublishConflict) {
            if ($pagePublishConflict->getPage()->getId() != $page->getId()) {
                return false;
            }
        }


        return true;
    }
public function validateUniqueForceUrlPublish(Page $page, Constraint $constraint)
    {

        if ($page->getForcedUrl() == null) {
            return true;
        }

        $em = $this->getDoctrine()->getManager();
        $pagePublishConflictList = $em->getRepository('KitpagesCmsBundle:PagePublish')->findBy(array('forcedUrl' => $page->getForcedUrl()));
        // there is no conflictual user
        if (empty($pagePublishConflictList)) {
            return true;
        }

        foreach ($pagePublishConflictList as $pagePublishConflict) {
            if ($pagePublishConflict->getPage()->getId() != $page->getId()) {
                return false;
            }
        }


        return true;
    }
//