src/bbn/appui/imessages.php
private function from_notes(array $messages, $simple = true){
    if ( !empty($messages) ){
      foreach ( $messages as $idx => $mess ){
        if ( empty($mess['id_note']) ){
          unset($messages[$idx]);
          continue;
        }
        $note = $this->notes->get($mess['id_note']);
        $note = [
          'id' => $mess['id'],
          'title' => $note['title'],
          'content' => $note['content']
        ];
        if ( $simple ){
          $messages[$idx] = $note;
        }
        else {
          $messages[$idx] = \bbn\x::merge_arrays($messages[$idx], $note);
        }
      }
    }
    return $messages;
  }
private function from_notes(array $messages, $simple = true){
    if ( !empty($messages) ){
      foreach ( $messages as $idx => $mess ){
        if ( empty($mess['id_note']) ){
          unset($messages[$idx]);
          continue;
        }
        $note = $this->notes->get($mess['id_note']);
        $note = [
          'id' => $mess['id'],
          'title' => $note['title'],
          'content' => $note['content']
        ];
        if ( $simple ){
          $messages[$idx] = $note;
        }
        else {
          $messages[$idx] = \bbn\x::merge_arrays($messages[$idx], $note);
        }
      }
    }
    return $messages;
  }
private function from_notes ( array $ messages , $ simple = true ) { if ( ! empty ( $ messages ) ) { foreach ( $ messages as $ idx => $ mess ) { if ( empty ( $ mess [ 'id_note' ] ) ) { unset ( $ messages [ $ idx ] ) ; continue ; } $ note = $ this -> notes -> get ( $ mess [ 'id_note' ] ) ; $ note = [ 'id' => $ mess [ 'id' ] , 'title' => $ note [ 'title' ] , 'content' => $ note [ 'content' ] ] ; if ( $ simple ) { $ messages [ $ idx ] = $ note ; } else { $ messages [ $ idx ] = \ bbn \ x :: merge_arrays ( $ messages [ $ idx ] , $ note ) ; } } } return $ messages ; }
Gets internal messages' info from notes archive

@param array $messages
@param bool $simple
@return array
Gets internal messages info from notes archive