Example #1
0
 public function adminSummary()
 {
     // set up $this->valueOptions for the parent summary
     $this->valueOptions = array();
     if ($this->value) {
         $result = entity_load_multiple_by_properties('user', array('uid' => $this->value));
         foreach ($result as $account) {
             if ($account->id()) {
                 $this->valueOptions[$account->id()] = $account->label();
             } else {
                 $this->valueOptions[$account->id()] = 'Anonymous';
                 // Intentionally NOT translated.
             }
         }
     }
     return parent::adminSummary();
 }
Example #2
0
 public function adminSummary()
 {
     // set up $this->valueOptions for the parent summary
     $this->valueOptions = array();
     if ($this->value) {
         $result = \Drupal::entityTypeManager()->getStorage('user')->loadByProperties(['uid' => $this->value]);
         foreach ($result as $account) {
             if ($account->id()) {
                 $this->valueOptions[$account->id()] = $account->label();
             } else {
                 $this->valueOptions[$account->id()] = 'Anonymous';
                 // Intentionally NOT translated.
             }
         }
     }
     return parent::adminSummary();
 }