| @@ 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. |
|
| @@ 955-984 (lines=30) @@ | ||
| 952 | * |
|
| 953 | * @return bool |
|
| 954 | */ |
|
| 955 | public function remove($action, $id = null) |
|
| 956 | { |
|
| 957 | /** @var $query \eZ\Publish\Core\Persistence\Database\DeleteQuery */ |
|
| 958 | $query = $this->dbHandler->createDeleteQuery(); |
|
| 959 | $query->deleteFrom( |
|
| 960 | $this->dbHandler->quoteTable('ezurlalias_ml') |
|
| 961 | )->where( |
|
| 962 | $query->expr->eq( |
|
| 963 | $this->dbHandler->quoteColumn('action'), |
|
| 964 | $query->bindValue($action, null, \PDO::PARAM_STR) |
|
| 965 | ) |
|
| 966 | ); |
|
| 967 | ||
| 968 | if ($id !== null) { |
|
| 969 | $query->where( |
|
| 970 | $query->expr->lAnd( |
|
| 971 | $query->expr->eq( |
|
| 972 | $this->dbHandler->quoteColumn('is_alias'), |
|
| 973 | $query->bindValue(0, null, \PDO::PARAM_INT) |
|
| 974 | ), |
|
| 975 | $query->expr->eq( |
|
| 976 | $this->dbHandler->quoteColumn('id'), |
|
| 977 | $query->bindValue($id, null, \PDO::PARAM_INT) |
|
| 978 | ) |
|
| 979 | ) |
|
| 980 | ); |
|
| 981 | } |
|
| 982 | ||
| 983 | $query->prepare()->execute(); |
|
| 984 | } |
|
| 985 | ||
| 986 | /** |
|
| 987 | * Loads all autogenerated entries with given $parentId with optionally included history entries. |
|