/**
  * Returns modification updates for the given EntityContent.
  *
  * @see EntityHandler::getEntityModificationUpdates
  *
  * @since 0.5
  *
  * @param EntityContent $content
  * @param Title $title
  *
  * @return DataUpdate[]
  */
 public function getEntityModificationUpdates(EntityContent $content, Title $title)
 {
     $updates = array();
     if ($content->isRedirect()) {
         $updates[] = new DataUpdateAdapter(array($this->siteLinkStore, 'deleteLinksOfItem'), $content->getEntityId());
     } else {
         $updates[] = new DataUpdateAdapter(array($this->siteLinkStore, 'saveLinksOfItem'), $content->getEntity());
     }
     return array_merge($updates, parent::getEntityModificationUpdates($content, $title));
 }
 /**
  * @dataProvider instanceProvider
  * @param EntityHandler $entityHandler
  */
 public function testGetSpecialPageForCreation(EntityHandler $entityHandler)
 {
     $specialPageName = $entityHandler->getSpecialPageForCreation();
     $this->assertTrue($specialPageName === null || is_string($specialPageName));
 }
Пример #3
0
 /**
  * @param EntityPerPage $entityPerPage
  * @param TermIndex $termIndex
  * @param EntityContentDataCodec $contentCodec
  * @param EntityConstraintProvider $constraintProvider
  * @param ValidatorErrorLocalizer $errorLocalizer
  * @param EntityIdParser $entityIdParser
  * @param callable|null $legacyExportFormatDetector
  */
 public function __construct(EntityPerPage $entityPerPage, TermIndex $termIndex, EntityContentDataCodec $contentCodec, EntityConstraintProvider $constraintProvider, ValidatorErrorLocalizer $errorLocalizer, EntityIdParser $entityIdParser, $legacyExportFormatDetector = null)
 {
     parent::__construct(CONTENT_MODEL_WIKIBASE_MEDIAINFO, $entityPerPage, $termIndex, $contentCodec, $constraintProvider, $errorLocalizer, $entityIdParser, $legacyExportFormatDetector);
 }