| @@ 590-609 (lines=20) @@ | ||
| 587 | * @param string $textMD5 |
|
| 588 | * @param array $values associative array with column names as keys and column values as values |
|
| 589 | */ |
|
| 590 | public function updateRow($parentId, $textMD5, array $values) |
|
| 591 | { |
|
| 592 | /** @var $query \eZ\Publish\Core\Persistence\Database\UpdateQuery */ |
|
| 593 | $query = $this->dbHandler->createUpdateQuery(); |
|
| 594 | $query->update($this->dbHandler->quoteTable($this->table)); |
|
| 595 | $this->setQueryValues($query, $values); |
|
| 596 | $query->where( |
|
| 597 | $query->expr->lAnd( |
|
| 598 | $query->expr->eq( |
|
| 599 | $this->dbHandler->quoteColumn('parent'), |
|
| 600 | $query->bindValue($parentId, null, \PDO::PARAM_INT) |
|
| 601 | ), |
|
| 602 | $query->expr->eq( |
|
| 603 | $this->dbHandler->quoteColumn('text_md5'), |
|
| 604 | $query->bindValue($textMD5, null, \PDO::PARAM_STR) |
|
| 605 | ) |
|
| 606 | ) |
|
| 607 | ); |
|
| 608 | $query->prepare()->execute(); |
|
| 609 | } |
|
| 610 | ||
| 611 | /** |
|
| 612 | * Inserts new row in urlalias_ml table. |
|
| @@ 740-763 (lines=24) @@ | ||
| 737 | * |
|
| 738 | * @return array |
|
| 739 | */ |
|
| 740 | public function loadRow($parentId, $textMD5) |
|
| 741 | { |
|
| 742 | /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */ |
|
| 743 | $query = $this->dbHandler->createSelectQuery(); |
|
| 744 | $query->select('*')->from( |
|
| 745 | $this->dbHandler->quoteTable($this->table) |
|
| 746 | )->where( |
|
| 747 | $query->expr->lAnd( |
|
| 748 | $query->expr->eq( |
|
| 749 | $this->dbHandler->quoteColumn('parent'), |
|
| 750 | $query->bindValue($parentId, null, \PDO::PARAM_INT) |
|
| 751 | ), |
|
| 752 | $query->expr->eq( |
|
| 753 | $this->dbHandler->quoteColumn('text_md5'), |
|
| 754 | $query->bindValue($textMD5, null, \PDO::PARAM_STR) |
|
| 755 | ) |
|
| 756 | ) |
|
| 757 | ); |
|
| 758 | ||
| 759 | $statement = $query->prepare(); |
|
| 760 | $statement->execute(); |
|
| 761 | ||
| 762 | return $statement->fetch(\PDO::FETCH_ASSOC); |
|
| 763 | } |
|
| 764 | ||
| 765 | /** |
|
| 766 | * Loads complete URL alias data by given array of path hashes. |
|