/** * @param Snak a snak with the same property * @throw Exception */ public function setMainSnak(Snak $snak) { if (!$this->mainSnak->getPropertyID()->equals($snak->getPropertyID())) { throw new Exception('Different property id!'); } $this->mainSnak = $snak; $this->changes['mainsnak'] = $snak->toArray(); }