/** * Rebuilds the path for a single category * * @param int $categoryId * @param String $categoryPath * @return int */ public function rebuildPath($categoryId, $categoryPath = null) { $updateStmt = $this->connection->prepare('UPDATE s_categories set path = :path WHERE id = :categoryId'); $parents = $this->categoryDenormalization->getParentCategoryIds($categoryId); array_shift($parents); if (empty($parents)) { $path = null; } else { $path = implode('|', $parents); $path = '|' . $path . '|'; } if ($categoryPath != $path) { $updateStmt->execute(array(':path' => $path, ':categoryId' => $categoryId)); return 1; } return 0; }
/** * @return CategoryDenormalization */ public function getCategoryComponent() { $this->categoryDenormalization->disableTransactions(); return $this->categoryDenormalization; }
public function testDisableTransactions() { $this->component->disableTransactions(); $this->assertFalse($this->component->transactionsEnabled()); }