public function findByTimetableAndDomId($timetableId, $domId)
    {
        $block = $this->findOneBy(
            array(
                'timetable' => $timetableId,
                'domId' => $domId,
            )
        );
        // no block found so create first a non persistent block
        if (empty($block)) {
            $block = new Block();
            $block->setDomId($domId);
            $timetable = $this->getEntityManager()->getRepository('CanalTPMttBundle:Timetable')->find(
                $timetableId
            );
            $block->setTimetable($timetable);
        }

        return $block;
    }