original_string: public function getElements()
      {
          // ATOM feeds have some specific requirements...
          if ($this->version == Feed::ATOM)
          {
              // Add an 'id' element, if it was not added by calling the setLink method.
              // Use the value of the title element as key, since no link element was specified.
              if (!array_key_exists('id', $this->elements))
                  $this->setId(Feed::uuid($this->elements['title']['content'], 'urn:uuid:'));
  
              // Either a 'link' or 'content' element is needed.
              if (!array_key_exists('content', $this->elements) && !array_key_exists('link', $this->elements))
                  throw new InvalidOperationException('ATOM feed entries need a link or a content element. Call the setLink or setContent method.');
          }
          // ...same with RSS1 feeds.
          else if ($this->version == Feed::RSS1)
          {
              if (!array_key_exists('title', $this->elements))
                  throw new InvalidOperationException('RSS1 feed entries need a title element. Call the setTitle method.');
              if (!array_key_exists('link', $this->elements))
                  throw new InvalidOperationException('RSS1 feed entries need a link element. Call the setLink method.');
          }
  
          return $this->elements;
      }
code: public function getElements()
      {
          // ATOM feeds have some specific requirements...
          if ($this->version == Feed::ATOM)
          {
              // Add an 'id' element, if it was not added by calling the setLink method.
              // Use the value of the title element as key, since no link element was specified.
              if (!array_key_exists('id', $this->elements))
                  $this->setId(Feed::uuid($this->elements['title']['content'], 'urn:uuid:'));
  
              // Either a 'link' or 'content' element is needed.
              if (!array_key_exists('content', $this->elements) && !array_key_exists('link', $this->elements))
                  throw new InvalidOperationException('ATOM feed entries need a link or a content element. Call the setLink or setContent method.');
          }
          // ...same with RSS1 feeds.
          else if ($this->version == Feed::RSS1)
          {
              if (!array_key_exists('title', $this->elements))
                  throw new InvalidOperationException('RSS1 feed entries need a title element. Call the setTitle method.');
              if (!array_key_exists('link', $this->elements))
                  throw new InvalidOperationException('RSS1 feed entries need a link element. Call the setLink method.');
          }
  
          return $this->elements;
      }
code_tokens: public function getElements ( ) { // ATOM feeds have some specific requirements... if ( $ this -> version == Feed :: ATOM ) { // Add an 'id' element, if it was not added by calling the setLink method. // Use the value of the title element as key, since no link element was specified. if ( ! array_key_exists ( 'id' , $ this -> elements ) ) $ this -> setId ( Feed :: uuid ( $ this -> elements [ 'title' ] [ 'content' ] , 'urn:uuid:' ) ) ; // Either a 'link' or 'content' element is needed. if ( ! array_key_exists ( 'content' , $ this -> elements ) && ! array_key_exists ( 'link' , $ this -> elements ) ) throw new InvalidOperationException ( 'ATOM feed entries need a link or a content element. Call the setLink or setContent method.' ) ; } // ...same with RSS1 feeds. else if ( $ this -> version == Feed :: RSS1 ) { if ( ! array_key_exists ( 'title' , $ this -> elements ) ) throw new InvalidOperationException ( 'RSS1 feed entries need a title element. Call the setTitle method.' ) ; if ( ! array_key_exists ( 'link' , $ this -> elements ) ) throw new InvalidOperationException ( 'RSS1 feed entries need a link element. Call the setLink method.' ) ; } return $ this -> elements ; }
docstring: Return the collection of elements in this feed item
  
  @access   public
  @return   array   All elements of this item.
  @throws   InvalidOperationException on ATOM feeds if either a content or link element is missing.
  @throws   InvalidOperationException on RSS1 feeds if a title or link element is missing.
docstring_tokens: Return the collection of elements in this feed item