public function removeBlock(Block $block)
	{
		if (! $this->equals($block->getPlaceHolder())
				|| ! $this->blocks->contains($block)) {
			throw new \InvalidArgumentException('Block does not belongs to this placeholder.');
		}

		$position = $block->getPosition();
	
		$this->blocks->removeElement($block);

		foreach ($this->blocks as $existingBlock) {
			if ($existingBlock->getPosition() > $position) {
				$existingBlock->setPosition($existingBlock->getPosition() - 1);
			}
		}
	}
public function removeBlock(Block $block)
	{
		if (! $this->equals($block->getPlaceHolder())
				|| ! $this->blocks->contains($block)) {
			throw new \InvalidArgumentException('Block does not belongs to this placeholder.');
		}

		$position = $block->getPosition();
	
		$this->blocks->removeElement($block);

		foreach ($this->blocks as $existingBlock) {
			if ($existingBlock->getPosition() > $position) {
				$existingBlock->setPosition($existingBlock->getPosition() - 1);
			}
		}
	}
public function removeBlock ( Block $ block ) { if ( ! $ this -> equals ( $ block -> getPlaceHolder ( ) ) || ! $ this -> blocks -> contains ( $ block ) ) { throw new \ InvalidArgumentException ( 'Block does not belongs to this placeholder.' ) ; } $ position = $ block -> getPosition ( ) ; $ this -> blocks -> removeElement ( $ block ) ; foreach ( $ this -> blocks as $ existingBlock ) { if ( $ existingBlock -> getPosition ( ) > $ position ) { $ existingBlock -> setPosition ( $ existingBlock -> getPosition ( ) - 1 ) ; } } }
Removes block from collection and recalculates other blocks position indexes.

@param Block $block
@throws \InvalidArgumentException
Removes block from collection and recalculates other blocks position indexes .