Code Duplication    Length = 27-30 lines in 2 locations

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

@@ 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.

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

@@ 995-1024 (lines=30) @@
992
     *
993
     * @return bool
994
     */
995
    public function remove($action, $id = null)
996
    {
997
        /** @var $query \eZ\Publish\Core\Persistence\Database\DeleteQuery */
998
        $query = $this->dbHandler->createDeleteQuery();
999
        $query->deleteFrom(
1000
            $this->dbHandler->quoteTable('ezurlalias_ml')
1001
        )->where(
1002
            $query->expr->eq(
1003
                $this->dbHandler->quoteColumn('action'),
1004
                $query->bindValue($action, null, \PDO::PARAM_STR)
1005
            )
1006
        );
1007
1008
        if ($id !== null) {
1009
            $query->where(
1010
                $query->expr->lAnd(
1011
                    $query->expr->eq(
1012
                        $this->dbHandler->quoteColumn('is_alias'),
1013
                        $query->bindValue(0, null, \PDO::PARAM_INT)
1014
                    ),
1015
                    $query->expr->eq(
1016
                        $this->dbHandler->quoteColumn('id'),
1017
                        $query->bindValue($id, null, \PDO::PARAM_INT)
1018
                    )
1019
                )
1020
            );
1021
        }
1022
1023
        $query->prepare()->execute();
1024
    }
1025
1026
    /**
1027
     * Loads all autogenerated entries with given $parentId with optionally included history entries.