Deletes node assignment for given $contentId and $versionNo.

@param int $contentId
@param int $versionNo
6771
public function deleteNodeAssignment($contentId, $versionNo = null)
    {
        try {
            return $this->innerGateway->deleteNodeAssignment($contentId, $versionNo);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
909111
public static function purgeByParentAndContentObjectID( $parentNodeID, $contentObjectID )
    {
        eZDB::instance()->query(
            "DELETE FROM eznode_assignment WHERE parent_node=" . (int)$parentNodeID ." AND contentobject_id=" . (int)$contentObjectID
        );
    }
377485
public static function delete($versionid) {
        global $DB;

        $version = static::get_policy_version($versionid);
        if (!self::can_delete_version($version)) {
            // Current version can not be deleted.
            return;
        }

        $DB->delete_records('tool_policy_versions', ['id' => $versionid]);

        if (!$DB->record_exists('tool_policy_versions', ['policyid' => $version->policyid])) {
            // This is a single version in a policy. Delete the policy.
            $DB->delete_records('tool_policy', ['id' => $version->policyid]);
        }
    }
1076697
public function linkUrl($urlId, $fieldId, $versionNo)
    {
        $query = $this->connection->createQueryBuilder();

        $query
            ->insert($this->connection->quoteIdentifier(self::URL_LINK_TABLE))
            ->values(
                [
                    'contentobject_attribute_id' => ':contentobject_attribute_id',
                    'contentobject_attribute_version' => ':contentobject_attribute_version',
                    'url_id' => ':url_id',
                ]
            )
            ->setParameter(':contentobject_attribute_id', $fieldId, PDO::PARAM_INT)
            ->setParameter(':contentobject_attribute_version', $versionNo, PDO::PARAM_INT)
            ->setParameter(':url_id', $urlId, PDO::PARAM_INT)
        ;

        $query->execute();
    }
155089
function deleteStoredObjectAttribute( $contentObjectAttribute, $version = null )
    {
        $version = $contentObjectAttribute->objectVersion();
        if ( !is_null( $version ) &&
             $version->attribute( 'status' ) == eZContentObjectVersion::STATUS_PUBLISHED )
        {
            $contentObjectID = $contentObjectAttribute->attribute( 'contentobject_id' );
            $languageID = $contentObjectAttribute->attribute( 'language_id' );
            eZPersistentObject::removeObject( ezcomComment::definition(), 
                                              array( 'contentobject_id' => $contentObjectID,
                                                     'language_id' => $languageID ) );
        }
    }
1332393
public function updateNodeAssignment($contentObjectId, $oldParent, $newParent, $opcode)
    {
        $query = $this->handler->createUpdateQuery();
        $query
            ->update($this->handler->quoteTable('eznode_assignment'))
            ->set(
                $this->handler->quoteColumn('parent_node'),
                $query->bindValue($newParent, null, \PDO::PARAM_INT)
            )
            ->set(
                $this->handler->quoteColumn('op_code'),
                $query->bindValue($opcode, null, \PDO::PARAM_INT)
            )
            ->where(
                $query->expr->lAnd(
                    $query->expr->eq(
                        $this->handler->quoteColumn('contentobject_id'),
                        $query->bindValue($contentObjectId, null, \PDO::PARAM_INT)
                    ),
                    $query->expr->eq(
                        $this->handler->quoteColumn('parent_node'),
                        $query->bindValue($oldParent, null, \PDO::PARAM_INT)
                    )
                )
            );
        $query->prepare()->execute();
    }
843825
public function deleteVersionById(string $modelId, string $versionId)
    {
        $deleteResult = $this->getRequest()->request(
            'DELETE',
            $this->getRequestUrl(sprintf('models/%s/versions/%s', $modelId, $versionId))
        );

        return $deleteResult['status'];
    }
371741
public function deleteContentTypeDraft($contentTypeId)
    {
        $contentTypeDraft = $this->contentTypeService->loadContentTypeDraft($contentTypeId);
        $this->contentTypeService->deleteContentType($contentTypeDraft);

        return new Values\NoContent();
    }
1141454
public function createNewVersionNode(NodeInterface $originalNode, $versionName = '')
    {
        $status = $this->statusRepository->findOneByInitial();

        /** @var NodeInterface $newNode */
        $newNode = clone $originalNode;
        $newNode->setStatus($status);
        $newNode->setVersion($this->uniqueIdGenerator->generateUniqueId());
        $this->duplicateArea($originalNode, $newNode);

        $newNode->setVersionName($versionName);
        if (empty($versionName)) {
            $newNode = $this->setVersionName($newNode);
        }


        return $newNode;
    }
1282184
protected function findOneContent($contentId, $language, $version = null)
    {
        $contentRepository = $this->get('open_orchestra_model.repository.content');
        $content = $contentRepository->findOneByLanguageAndVersion($contentId, $language, $version);

        return $content;
    }
408061
public function removeImageReferences($uri, $versionNo, $fieldId)
    {
        $path = $this->redecorator->redecorateFromSource($uri);

        if (!$this->canRemoveImageReference($path, $versionNo, $fieldId)) {
            return;
        }

        $connection = $this->getConnection();

        $deleteQuery = $connection->createDeleteQuery();
        $deleteQuery->deleteFrom(
            $connection->quoteTable('ezimagefile')
        )->where(
            $deleteQuery->expr->lAnd(
                $deleteQuery->expr->eq(
                    $connection->quoteColumn('contentobject_attribute_id'),
                    $deleteQuery->bindValue($fieldId, null, \PDO::PARAM_INT)
                ),
                $deleteQuery->expr->like(
                    $connection->quoteColumn('filepath'),
                    $deleteQuery->bindValue($path . '%')
                )
            )
        );

        $statement = $deleteQuery->prepare();
        $statement->execute();
    }
587157
public function createLocationsFromNodeAssignments($contentId, $versionNo)
    {
        // select all node assignments with OP_CODE_CREATE (3) for this content
        $query = $this->handler->createSelectQuery();
        $query
            ->select('*')
            ->from($this->handler->quoteTable('eznode_assignment'))
            ->where(
                $query->expr->lAnd(
                    $query->expr->eq(
                        $this->handler->quoteColumn('contentobject_id'),
                        $query->bindValue($contentId, null, \PDO::PARAM_INT)
                    ),
                    $query->expr->eq(
                        $this->handler->quoteColumn('contentobject_version'),
                        $query->bindValue($versionNo, null, \PDO::PARAM_INT)
                    ),
                    $query->expr->eq(
                        $this->handler->quoteColumn('op_code'),
                        $query->bindValue(self::NODE_ASSIGNMENT_OP_CODE_CREATE, null, \PDO::PARAM_INT)
                    )
                )
            )->orderBy('id');
        $statement = $query->prepare();
        $statement->execute();

        // convert all these assignments to nodes

        while ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
            if ((bool)$row['is_main'] === true) {
                $mainLocationId = true;
            } else {
                $mainLocationId = $this->getMainNodeId($contentId);
            }

            $parentLocationData = $this->getBasicNodeData($row['parent_node']);
            $isInvisible = $row['is_hidden'] || $parentLocationData['is_hidden'] || $parentLocationData['is_invisible'];
            $this->create(
                new CreateStruct(
                    array(
                        'contentId' => $row['contentobject_id'],
                        'contentVersion' => $row['contentobject_version'],
                        'mainLocationId' => $mainLocationId,
                        'remoteId' => $row['parent_remote_id'],
                        'sortField' => $row['sort_field'],
                        'sortOrder' => $row['sort_order'],
                        'priority' => $row['priority'],
                        'hidden' => $row['is_hidden'],
                        'invisible' => $isInvisible,
                    )
                ),
                $parentLocationData
            );

            $this->updateNodeAssignment(
                $row['contentobject_id'],
                $row['parent_node'],
                $row['parent_node'],
                self::NODE_ASSIGNMENT_OP_CODE_CREATE_NOP
            );
        }
    }
134194
static public function updateNontranslatableAttributes( $objectID, $versionNum )
    {
        $object = eZContentObject::fetch( $objectID );
        $version = $object->version( $versionNum );

        $nonTranslatableAttributes = $version->nonTranslatableAttributesToUpdate();
        if ( $nonTranslatableAttributes )
        {
            $attributes = $version->contentObjectAttributes( $version->initialLanguageCode() );
            $attributeByClassAttrID = array();
            foreach ( $attributes as $attribute )
            {
                $attributeByClassAttrID[$attribute->attribute( 'contentclassattribute_id' )] = $attribute;
            }

            foreach ( $nonTranslatableAttributes as $attributeToUpdate )
            {
                $originalAttribute =& $attributeByClassAttrID[$attributeToUpdate->attribute( 'contentclassattribute_id' )];
                if ( $originalAttribute )
                {
                    unset( $tmp );
                    $tmp = $attributeToUpdate;
                    $tmp->initialize( $attributeToUpdate->attribute( 'version' ), $originalAttribute );
                    $tmp->setAttribute( 'id', $attributeToUpdate->attribute( 'id' ) );
                    $tmp->setAttribute( 'language_code', $attributeToUpdate->attribute( 'language_code' ) );
                    $tmp->setAttribute( 'language_id', $attributeToUpdate->attribute( 'language_id' ) );
                    $tmp->setAttribute( 'attribute_original_id', $originalAttribute->attribute( 'id' ) );
                    $tmp->store();
                    $tmp->postInitialize( $attributeToUpdate->attribute( 'version' ), $originalAttribute );
                }
            }
        }
    }
583183
public function copyRelations($originalContentId, $copiedContentId, $versionNo = null)
    {
        try {
            return $this->innerGateway->copyRelations($originalContentId, $copiedContentId, $versionNo);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
1309735
public function deleteContent($contentId, $versionId = null)
    {
        // 1. Delete the Content
        if ($versionId === null) {
            $this->gateway->deleteByQuery(json_encode(['query' => ['match' => ['_id' => $contentId]]]), $this->contentDocumentTypeIdentifier);
        } else {
            $this->gateway->delete($contentId, $this->contentDocumentTypeIdentifier);
        }

        // 2. Delete all Content's Locations
        $this->gateway->deleteByQuery(json_encode(['query' => ['match' => ['content_id_id' => $contentId]]]), $this->locationDocumentTypeIdentifier);
    }
596795
public function linkUrl($urlId, $fieldId, $versionNo)
    {
        $dbHandler = $this->getConnection();

        $q = $dbHandler->createInsertQuery();
        $q->insertInto(
            $dbHandler->quoteTable(self::URL_LINK_TABLE)
        )->set(
            $dbHandler->quoteColumn('contentobject_attribute_id'),
            $q->bindValue($fieldId, null, PDO::PARAM_INT)
        )->set(
            $dbHandler->quoteColumn('contentobject_attribute_version'),
            $q->bindValue($versionNo, null, PDO::PARAM_INT)
        )->set(
            $dbHandler->quoteColumn('url_id'),
            $q->bindValue($urlId, null, PDO::PARAM_INT)
        );

        $q->prepare()->execute();
    }
696904
public function deleteFieldData( VersionInfo $versionInfo, array $fieldIds )
    {
        $connection = $this->getConnection();

        $query = $connection->createDeleteQuery();
        $query
            ->deleteFrom( $connection->quoteTable( self::TABLE ) )
            ->where(
                $query->expr->lAnd(
                    $query->expr->in(
                        $connection->quoteColumn( "objectattribute_id" ),
                        $fieldIds
                    ),
                    $query->expr->eq(
                        $connection->quoteColumn( "objectattribute_version" ),
                        $query->bindValue( $versionInfo->versionNo, null, PDO::PARAM_INT )
                    )
                )
            );

        $query->prepare()->execute();
    }