예제 #1
0
 /**
  * {@inheritDoc}
  */
 public function getLabel()
 {
     if (null === $this->label) {
         $fields = $this->getFields();
         if (1 == count($fields)) {
             $field = current(array_keys($fields));
             switch ($field) {
                 case 'identity':
                     $this->label = __('Username');
                     break;
                 case 'email':
                     $this->label = __('Email');
                     break;
                 default:
                     $this->label = __('Identity');
                     break;
             }
         } else {
             $this->label = __('Identity');
         }
     }
     return parent::getLabel();
 }