public function findOneByRecord(myDoctrineRecord $record) { return $this->createQuery('p')->where('p.module = ?', $record->getDmModule()->getKey())->andWhere('p.action = ?', 'show')->andWhere('p.record_id = ?', $record->get('id'))->fetchRecord(); }