Exemplo n.º 1
0
 /**
  * Returns the Item that makes up this ItemContent.
  *
  * @throws MWException when it's a redirect (targets will never be resolved)
  * @throws LogicException
  * @return Item
  */
 public function getItem()
 {
     $redirect = $this->getRedirectTarget();
     if ($redirect) {
         throw new MWException('Unresolved redirect to [[' . $redirect->getFullText() . ']]');
     }
     if (!$this->itemHolder) {
         throw new LogicException('Neither redirect nor item found in ItemContent!');
     }
     return $this->itemHolder->getEntity('Wikibase\\DataModel\\Entity\\Item');
 }
 /**
  * @see EntityHolder::getEntityType
  *
  * @return string
  */
 public function getEntityType()
 {
     return $this->entityHolder->getEntityType();
 }
Exemplo n.º 3
0
 /**
  * Gets the property that makes up this property content.
  *
  * @return Property
  */
 public function getProperty()
 {
     return $this->propertyHolder->getEntity('Wikibase\\DataModel\\Entity\\Property');
 }
Exemplo n.º 4
0
 /**
  * @return MediaInfo
  */
 public function getMedium()
 {
     return $this->mediumHolder->getEntity('WikibaseMedia\\DataModel\\Medium');
 }