/** * Do not use to construct new stuff from outside of this class, * use the static newFoobar methods. * * In other words: treat as protected (which it was, but now * cannot be since we derive from Content). * * @protected * * @param EntityHolder $propertyHolder * @throws InvalidArgumentException */ public function __construct(EntityHolder $propertyHolder) { parent::__construct(CONTENT_MODEL_WIKIBASE_PROPERTY); if ($propertyHolder->getEntityType() !== Property::ENTITY_TYPE) { throw new InvalidArgumentException('$propertyHolder must contain a Property entity!'); } $this->propertyHolder = $propertyHolder; }
/** * Do not use to construct new stuff from outside of this class, * use the static newFoobar methods. * * In other words: treat as protected (which it was, but now * cannot be since we derive from Content). * * @protected * * @param EntityHolder $mediumHolder * @throws InvalidArgumentException */ public function __construct(EntityHolder $mediumHolder) { parent::__construct(CONTENT_MODEL_WIKIBASE_MEDIAINFO); if ($mediumHolder->getEntityType() !== MediaInfo::ENTITY_TYPE) { throw new InvalidArgumentException('$mediumHolder must contain a Medium entity!'); } $this->mediumHolder = $mediumHolder; }
/** * @see EntityHolder::getEntityType * * @return string */ public function getEntityType() { return $this->entityHolder->getEntityType(); }