/** * @param int $idPageBlock * @param int $position * @throws \Pav\Zed\CmsBlock\Business\Exception\PageBlockDoesNotExistException * @throws \Propel\Runtime\Exception\PropelException * * @return void */ public function updatePageBlockPosition($idPageBlock, $position) { $pageBlock = $this->queryContainer->queryPageBlockById($idPageBlock)->findOne(); if ($pageBlock === null) { throw new PageBlockDoesNotExistException(sprintf('Page block id: "%s" does not exist.', $idPageBlock)); } $pageBlock->setPosition((int) $position); $pageBlock->save(); $this->touchPage($pageBlock->getFkPage()); }