Esempio n. 1
0
 /**
  * Return a wiki page value that can be used for displaying this
  * property, or null if no such wiki page exists (for predefined
  * properties without any label).
  * @return SMWWikiPageValue or null
  */
 public function getWikiPageValue()
 {
     if (!isset($this->m_wikipage)) {
         $diWikiPage = $this->m_dataitem->getDiWikiPage();
         if (!is_null($diWikiPage)) {
             $this->m_wikipage = \SMW\DataValueFactory::getInstance()->newDataItemValue($diWikiPage, null, $this->m_caption);
             $this->m_wikipage->setOutputFormat($this->m_outformat);
             $this->addError($this->m_wikipage->getErrors());
         } else {
             // should rarely happen ($value is only changed if the input $value really was a label for a predefined prop)
             $this->m_wikipage = null;
         }
     }
     return $this->m_wikipage;
 }
 /**
  * Return a wiki page value that can be used for displaying this
  * property, or null if no such wiki page exists (for predefined
  * properties without any label).
  * @return SMWWikiPageValue or null
  */
 public function getWikiPageValue()
 {
     if (isset($this->m_wikipage)) {
         return $this->m_wikipage;
     }
     $diWikiPage = $this->m_dataitem->getCanonicalDiWikiPage();
     if ($diWikiPage !== null) {
         $this->m_wikipage = DataValueFactory::getInstance()->newDataValueByItem($diWikiPage, null, $this->m_caption);
         $this->m_wikipage->setOutputFormat($this->m_outformat);
         $this->m_wikipage->setLinkAttributes($this->linkAttributes);
         $this->m_wikipage->setOptions($this->getOptions());
         $this->addError($this->m_wikipage->getErrors());
     } else {
         // should rarely happen ($value is only changed if the input $value really was a label for a predefined prop)
         $this->m_wikipage = null;
     }
     return $this->m_wikipage;
 }
 /**
  * Return a wiki page value that can be used for displaying this
  * property, or null if no such wiki page exists (for predefined
  * properties without any label).
  * @return SMWWikiPageValue or null
  */
 public function getWikiPageValue()
 {
     if (!isset($this->m_wikipage)) {
         $diWikiPage = $this->m_dataitem->getDiWikiPage();
         // A page representation for an inverse property is not possible
         // therefore construct its non-inverse representation (label/caption
         // remains and will show with an inverse indicator)
         if ($diWikiPage === null && $this->m_dataitem->isInverse()) {
             $property = new SMWDIProperty($this->m_dataitem->getKey());
             $diWikiPage = $property->getDiWikiPage();
         }
         if ($diWikiPage !== null) {
             $this->m_wikipage = \SMW\DataValueFactory::getInstance()->newDataItemValue($diWikiPage, null, $this->m_caption);
             $this->m_wikipage->setOutputFormat($this->m_outformat);
             $this->addError($this->m_wikipage->getErrors());
         } else {
             // should rarely happen ($value is only changed if the input $value really was a label for a predefined prop)
             $this->m_wikipage = null;
         }
     }
     return $this->m_wikipage;
 }