public function getContentReference($entity)
 {
     $dql = "SELECT e.id, e.title FROM {$entity} e";
     $result = $this->em->createQuery($dql)->getArrayResult();
     $return = array();
     foreach ($result as $reference) {
         $return[$reference['id']] = $reference['title'];
     }
     return $return;
 }
 /**
  * [retrieveByCredentials description].
  *
  * @param array $credentials [description]
  *
  * @return [type] [description]
  */
 public function findByCredentials($user, array $credentials)
 {
     if ($this->use_local_connection) {
         $query = $this->dm->createQuery($this->config['viewsname'], 'remoteCredentials');
     } else {
         $query = $this->dm->createQuery($this->config['viewsname'], 'remoteCredentials');
     }
     $result = $query->setKey($credentials[$this->config['username_field']])->onlyDocs(false)->setLimit(1)->execute();
     $userPassword = $this->config['encrypt_password'] ? \Crypt::decrypt($result[0]['value'][$this->config['remote_password_field']]) : $result[0]['value'][$this->config['remote_password_field']];
     if ($userPassword === $credentials[$this->config['password_field']]) {
         return $result[0];
     }
     return;
 }