Code Duplication    Length = 27-30 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Content/Location/Gateway/DoctrineDatabase.php 1 location

@@ 871-897 (lines=27) @@
868
     * @param int $newParent
869
     * @param int $opcode
870
     */
871
    public function updateNodeAssignment($contentObjectId, $oldParent, $newParent, $opcode)
872
    {
873
        $query = $this->handler->createUpdateQuery();
874
        $query
875
            ->update($this->handler->quoteTable('eznode_assignment'))
876
            ->set(
877
                $this->handler->quoteColumn('parent_node'),
878
                $query->bindValue($newParent, null, \PDO::PARAM_INT)
879
            )
880
            ->set(
881
                $this->handler->quoteColumn('op_code'),
882
                $query->bindValue($opcode, null, \PDO::PARAM_INT)
883
            )
884
            ->where(
885
                $query->expr->lAnd(
886
                    $query->expr->eq(
887
                        $this->handler->quoteColumn('contentobject_id'),
888
                        $query->bindValue($contentObjectId, null, \PDO::PARAM_INT)
889
                    ),
890
                    $query->expr->eq(
891
                        $this->handler->quoteColumn('parent_node'),
892
                        $query->bindValue($oldParent, null, \PDO::PARAM_INT)
893
                    )
894
                )
895
            );
896
        $query->prepare()->execute();
897
    }
898
899
    /**
900
     * Create locations from node assignments.

eZ/Publish/Core/Persistence/Legacy/Content/UrlAlias/Gateway/DoctrineDatabase.php 1 location

@@ 1041-1070 (lines=30) @@
1038
     *
1039
     * @return bool
1040
     */
1041
    public function remove($action, $id = null)
1042
    {
1043
        /** @var $query \eZ\Publish\Core\Persistence\Database\DeleteQuery */
1044
        $query = $this->dbHandler->createDeleteQuery();
1045
        $query->deleteFrom(
1046
            $this->dbHandler->quoteTable('ezurlalias_ml')
1047
        )->where(
1048
            $query->expr->eq(
1049
                $this->dbHandler->quoteColumn('action'),
1050
                $query->bindValue($action, null, \PDO::PARAM_STR)
1051
            )
1052
        );
1053
1054
        if ($id !== null) {
1055
            $query->where(
1056
                $query->expr->lAnd(
1057
                    $query->expr->eq(
1058
                        $this->dbHandler->quoteColumn('is_alias'),
1059
                        $query->bindValue(0, null, \PDO::PARAM_INT)
1060
                    ),
1061
                    $query->expr->eq(
1062
                        $this->dbHandler->quoteColumn('id'),
1063
                        $query->bindValue($id, null, \PDO::PARAM_INT)
1064
                    )
1065
                )
1066
            );
1067
        }
1068
1069
        $query->prepare()->execute();
1070
    }
1071
1072
    /**
1073
     * Loads all autogenerated entries with given $parentId with optionally included history entries.