public function getProgramOptions() {
    static $options = [];

    if (!$options) {
      $options = ['all' => $this->t('All')];
      $query = $this->entityQuery
        ->get('node')
        ->condition('status', 1)
        ->condition('type', 'program');
      $entity_ids = $query->execute();
      $nodes = $this->entityTypeManager->getStorage('node')
        ->loadMultiple($entity_ids);
      foreach ($nodes as $id => $node) {
        $options[$id] = $node->getTitle();
      }
    }

    return $options;
  }
public function getProgramOptions() {
    static $options = [];

    if (!$options) {
      $options = ['all' => $this->t('All')];
      $query = $this->entityQuery
        ->get('node')
        ->condition('status', 1)
        ->condition('type', 'program');
      $entity_ids = $query->execute();
      $nodes = $this->entityTypeManager->getStorage('node')
        ->loadMultiple($entity_ids);
      foreach ($nodes as $id => $node) {
        $options[$id] = $node->getTitle();
      }
    }

    return $options;
  }
public function getProgramOptions ( ) { static $ options = [ ] ; if ( ! $ options ) { $ options = [ 'all' => $ this -> t ( 'All' ) ] ; $ query = $ this -> entityQuery -> get ( 'node' ) -> condition ( 'status' , 1 ) -> condition ( 'type' , 'program' ) ; $ entity_ids = $ query -> execute ( ) ; $ nodes = $ this -> entityTypeManager -> getStorage ( 'node' ) -> loadMultiple ( $ entity_ids ) ; foreach ( $ nodes as $ id => $ node ) { $ options [ $ id ] = $ node -> getTitle ( ) ; } } return $ options ; }
Helper method retrieving program options.

@return array
Array of program options to be used in form element.
Helper method retrieving program options .