| @@ 831-857 (lines=27) @@ | ||
| 828 | * @param int $newParent |
|
| 829 | * @param int $opcode |
|
| 830 | */ |
|
| 831 | public function updateNodeAssignment($contentObjectId, $oldParent, $newParent, $opcode) |
|
| 832 | { |
|
| 833 | $query = $this->handler->createUpdateQuery(); |
|
| 834 | $query |
|
| 835 | ->update($this->handler->quoteTable('eznode_assignment')) |
|
| 836 | ->set( |
|
| 837 | $this->handler->quoteColumn('parent_node'), |
|
| 838 | $query->bindValue($newParent, null, \PDO::PARAM_INT) |
|
| 839 | ) |
|
| 840 | ->set( |
|
| 841 | $this->handler->quoteColumn('op_code'), |
|
| 842 | $query->bindValue($opcode, null, \PDO::PARAM_INT) |
|
| 843 | ) |
|
| 844 | ->where( |
|
| 845 | $query->expr->lAnd( |
|
| 846 | $query->expr->eq( |
|
| 847 | $this->handler->quoteColumn('contentobject_id'), |
|
| 848 | $query->bindValue($contentObjectId, null, \PDO::PARAM_INT) |
|
| 849 | ), |
|
| 850 | $query->expr->eq( |
|
| 851 | $this->handler->quoteColumn('parent_node'), |
|
| 852 | $query->bindValue($oldParent, null, \PDO::PARAM_INT) |
|
| 853 | ) |
|
| 854 | ) |
|
| 855 | ); |
|
| 856 | $query->prepare()->execute(); |
|
| 857 | } |
|
| 858 | ||
| 859 | /** |
|
| 860 | * Create locations from node assignments. |
|
| @@ 1009-1038 (lines=30) @@ | ||
| 1006 | * |
|
| 1007 | * @return bool |
|
| 1008 | */ |
|
| 1009 | public function remove($action, $id = null) |
|
| 1010 | { |
|
| 1011 | /** @var $query \eZ\Publish\Core\Persistence\Database\DeleteQuery */ |
|
| 1012 | $query = $this->dbHandler->createDeleteQuery(); |
|
| 1013 | $query->deleteFrom( |
|
| 1014 | $this->dbHandler->quoteTable('ezurlalias_ml') |
|
| 1015 | )->where( |
|
| 1016 | $query->expr->eq( |
|
| 1017 | $this->dbHandler->quoteColumn('action'), |
|
| 1018 | $query->bindValue($action, null, \PDO::PARAM_STR) |
|
| 1019 | ) |
|
| 1020 | ); |
|
| 1021 | ||
| 1022 | if ($id !== null) { |
|
| 1023 | $query->where( |
|
| 1024 | $query->expr->lAnd( |
|
| 1025 | $query->expr->eq( |
|
| 1026 | $this->dbHandler->quoteColumn('is_alias'), |
|
| 1027 | $query->bindValue(0, null, \PDO::PARAM_INT) |
|
| 1028 | ), |
|
| 1029 | $query->expr->eq( |
|
| 1030 | $this->dbHandler->quoteColumn('id'), |
|
| 1031 | $query->bindValue($id, null, \PDO::PARAM_INT) |
|
| 1032 | ) |
|
| 1033 | ) |
|
| 1034 | ); |
|
| 1035 | } |
|
| 1036 | ||
| 1037 | $query->prepare()->execute(); |
|
| 1038 | } |
|
| 1039 | ||
| 1040 | /** |
|
| 1041 | * Loads all autogenerated entries with given $parentId with optionally included history entries. |
|