blockId = (int)$blockId; $this->value = (int)$value; } /** * @inheritDoc */ public static function getType() { return static::TYPE; } /** * @inheritDoc */ public static function getTypeId() { return static::TYPE_ID; } /** * @inheritDoc */ public function getBlockId() { return $this->blockId; } /** * @inheritDoc */ public function setBlockId( $blockId ) { $this->blockId = (int)$blockId; return $this; } /** * @inheritDoc */ public function getValue() { return $this->value; } /** * @inheritDoc */ public static function newFromRow( \stdClass $row ) { // @phan-suppress-next-line PhanTypeInstantiateAbstractStatic return new static( $row->ir_ipb_id, $row->ir_value ); } /** * @inheritDoc */ public function toRow() { return [ 'ir_ipb_id' => $this->getBlockId(), 'ir_type' => $this->getTypeId(), 'ir_value' => $this->getValue(), ]; } /** * @inheritDoc */ public function equals( Restriction $other ) { return $this->getHash() === $other->getHash(); } /** * @inheritDoc */ public function getHash() { return $this->getType() . '-' . $this->getValue(); } }