/** * @inheritDoc */ public function getValueOptions() { foreach ($this->categoryStorage->loadByProperties() as $id => $category) { $this->valueOptions[$id] = $category->getName(); } return parent::getValueOptions(); }
/** * Retrieve a list of users. * * @return array * A list of moodle users. */ protected function getUsers() { $options = array('' => $this->t('Select')); foreach ($this->storage->loadMultiple() as $user) { $options[$user->id()] = $user->getName(); } return $options; }