| @@ 571-590 (lines=20) @@ | ||
| 568 | * @param string $textMD5 |
|
| 569 | * @param array $values associative array with column names as keys and column values as values |
|
| 570 | */ |
|
| 571 | public function updateRow($parentId, $textMD5, array $values) |
|
| 572 | { |
|
| 573 | /** @var $query \eZ\Publish\Core\Persistence\Database\UpdateQuery */ |
|
| 574 | $query = $this->dbHandler->createUpdateQuery(); |
|
| 575 | $query->update($this->dbHandler->quoteTable($this->table)); |
|
| 576 | $this->setQueryValues($query, $values); |
|
| 577 | $query->where( |
|
| 578 | $query->expr->lAnd( |
|
| 579 | $query->expr->eq( |
|
| 580 | $this->dbHandler->quoteColumn('parent'), |
|
| 581 | $query->bindValue($parentId, null, \PDO::PARAM_INT) |
|
| 582 | ), |
|
| 583 | $query->expr->eq( |
|
| 584 | $this->dbHandler->quoteColumn('text_md5'), |
|
| 585 | $query->bindValue($textMD5, null, \PDO::PARAM_STR) |
|
| 586 | ) |
|
| 587 | ) |
|
| 588 | ); |
|
| 589 | $query->prepare()->execute(); |
|
| 590 | } |
|
| 591 | ||
| 592 | /** |
|
| 593 | * Inserts new row in urlalias_ml table. |
|
| @@ 721-744 (lines=24) @@ | ||
| 718 | * |
|
| 719 | * @return array |
|
| 720 | */ |
|
| 721 | public function loadRow($parentId, $textMD5) |
|
| 722 | { |
|
| 723 | /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */ |
|
| 724 | $query = $this->dbHandler->createSelectQuery(); |
|
| 725 | $query->select('*')->from( |
|
| 726 | $this->dbHandler->quoteTable($this->table) |
|
| 727 | )->where( |
|
| 728 | $query->expr->lAnd( |
|
| 729 | $query->expr->eq( |
|
| 730 | $this->dbHandler->quoteColumn('parent'), |
|
| 731 | $query->bindValue($parentId, null, \PDO::PARAM_INT) |
|
| 732 | ), |
|
| 733 | $query->expr->eq( |
|
| 734 | $this->dbHandler->quoteColumn('text_md5'), |
|
| 735 | $query->bindValue($textMD5, null, \PDO::PARAM_STR) |
|
| 736 | ) |
|
| 737 | ) |
|
| 738 | ); |
|
| 739 | ||
| 740 | $statement = $query->prepare(); |
|
| 741 | $statement->execute(); |
|
| 742 | ||
| 743 | return $statement->fetch(\PDO::FETCH_ASSOC); |
|
| 744 | } |
|
| 745 | ||
| 746 | /** |
|
| 747 | * Loads complete URL alias data by given array of path hashes. |
|