Remove leftRelation

@param \TechPromux\DynamicQueryBundle\Entity\MetadataRelation $leftRelation
423070
public function removeLeftRelation(\TechPromux\DynamicQueryBundle\Entity\MetadataRelation $leftRelation)
    {
        $this->leftRelations->removeElement($leftRelation);
    }
1214870
public function delete(PersistenceContext $context, Delete $parentDelete)
    {
        $this->mode->removeRelationsQuery(
            $context,
            $this->mapper,
            $parentDelete,
            $this->childrenTable,
            $this->foreignKeyToParent,
            $parentDelete->getTable()->getPrimaryKeyColumn()
        );
    }
1116336
private void removeNestedItemsFromTopLevel(ResourceMap publishRelatedResources) {

        Set<CmsResource> toDelete = Sets.newHashSet();
        for (CmsResource parent : publishRelatedResources.keySet()) {
            if (toDelete.contains(parent)) {
                continue;
            }
            for (CmsResource child : publishRelatedResources.get(parent)) {
                if (publishRelatedResources.containsKey(child)) {
                    toDelete.add(child);
                }
            }
        }
        for (CmsResource delResource : toDelete) {
            publishRelatedResources.remove(delResource);
        }
    }
1346579
public function leftJoin($table, $criteria = null, $alias = null)
    {
        return $this->join($table, $criteria, self::LEFT_JOIN, $alias);
    }
1130711
public function remove($entity)
    {
        //Get meta information
        $meta = $this->getMeta($entity);

        //Get a hash of this entity
        $hash = $this->getHash($entity);

        if($meta instanceof NodeMeta)
        {
            $this->nodeEntitiesToRemove[$hash] = $entity;
        }

        else
        {
            $this->relationEntitiesToRemove[$hash] = $entity;
        }
    }
202655
public function remove(EntityRemoved $event)
    {
        $entity = $event->getEntity();
        $collection = $event->getCollection();
        $this->deleteRelation($entity, $collection);
    }
186020
public function detachLeft() : void
    {
        if ($this->left) {
            $this->left->setParent(null);

            $this->left = null;
        }
    }
347979
public function removeSkillRelatedByCompositeId(ChildSkill $skillRelatedByCompositeId)
    {
        if ($this->getSkillsRelatedByCompositeId()->contains($skillRelatedByCompositeId)) { $skillPart = new ChildSkillPart();

            $skillPart->setSkillRelatedByCompositeId($skillRelatedByCompositeId);
            if ($skillRelatedByCompositeId->isSkillRelatedByPartIdsLoaded()) {
                //remove the back reference if available
                $skillRelatedByCompositeId->getSkillRelatedByPartIds()->removeObject($this);
            }

            $skillPart->setSkillRelatedByPartId($this);
            $this->removePart(clone $skillPart);
            $skillPart->clear();

            $this->collSkillsRelatedByCompositeId->remove($this->collSkillsRelatedByCompositeId->search($skillRelatedByCompositeId));

            if (null === $this->skillsRelatedByCompositeIdScheduledForDeletion) {
                $this->skillsRelatedByCompositeIdScheduledForDeletion = clone $this->collSkillsRelatedByCompositeId;
                $this->skillsRelatedByCompositeIdScheduledForDeletion->clear();
            }

            $this->skillsRelatedByCompositeIdScheduledForDeletion->push($skillRelatedByCompositeId);
        }


        return $this;
    }
1041249
public void removeRelationship(String baseTableName,
			String relatedTableName, String relationAuthor, String relationName) {
		removeRelationship(baseTableName, relatedTableName,
				buildRelationName(relationAuthor, relationName));
	}
704766
public function addRelation(\TechPromux\DynamicQueryBundle\Entity\MetadataRelation $relation)
    {
        $this->relations[] = $relation;

        return $this;
    }
1207857
static function removeRelationObject( $contentObjectAttribute, $deletionItem )
    {
        if ( self::isItemPublished( $deletionItem ) )
        {
            return;
        }

        $hostObject = $contentObjectAttribute->attribute( 'object' );
        $hostObjectID = $hostObject->attribute( 'id' );

        // Do not try removing the object if present in trash
        // Only objects being really orphaned (not even being in trash) should be removed by this method.
        // See issue #019457
        if (
            (int)eZPersistentObject::count(
                eZContentObjectTrashNode::definition(),
                array( "contentobject_id" => $hostObjectID )
            ) > 0
        )
        {
            return;
        }

        $hostObjectVersions = $hostObject->versions();
        $isDeletionAllowed = true;

        // check if the relation item to be deleted is unique in the domain of all host-object versions
        foreach ( $hostObjectVersions as $version )
        {
            if ( $isDeletionAllowed and
                 $version->attribute( 'version' ) != $contentObjectAttribute->attribute( 'version' ) )
            {
                $relationAttribute = eZPersistentObject::fetchObjectList( eZContentObjectAttribute::definition(),
                                                                           null,
                                                                           array( 'version' => $version->attribute( 'version' ),
                                                                                  'contentobject_id' => $hostObjectID,
                                                                                  'contentclassattribute_id' => $contentObjectAttribute->attribute( 'contentclassattribute_id' ) ) );

                if ( count( $relationAttribute ) > 0 )
                {
                    $relationContent = $relationAttribute[0]->content();
                    if ( is_array( $relationContent ) and
                         is_array( $relationContent['relation_list'] ) )
                    {
                        foreach( $relationContent['relation_list'] as $relationItem )
                        {
                            if ( $deletionItem['contentobject_id'] == $relationItem['contentobject_id'] &&
                                 $deletionItem['contentobject_version'] == $relationItem['contentobject_version'] )
                            {
                                $isDeletionAllowed = false;
                                break 2;
                            }
                        }
                    }
                }
            }
        }

        if ( $isDeletionAllowed )
        {
            $subObjectVersion = eZContentObjectVersion::fetchVersion( $deletionItem['contentobject_version'],
                                                                      $deletionItem['contentobject_id'] );
            if ( $subObjectVersion instanceof eZContentObjectVersion )
            {
                $subObjectVersion->removeThis();
            }
            else
            {
                eZDebug::writeError( 'Cleanup of subobject-version failed. Could not fetch object from relation list.\n' .
                                     'Requested subobject id: ' . $deletionItem['contentobject_id'] . '\n' .
                                     'Requested Subobject version: ' . $deletionItem['contentobject_version'],
                                     __METHOD__ );
            }
        }
    }
1142186
private void deleteRelation(Object connection, EntityMetadata entityMetadata, String rowKey)
    {
        List<String> relations = entityMetadata.getRelationNames();

        if (relations != null)
        {
            for (String relation : relations)
            {
                if (resource != null && resource.isActive())
                {
                    ((Transaction) connection).hdel(getHashKey(entityMetadata.getTableName(), rowKey), relation);

                }
                else
                {
                    ((Pipeline) connection).hdel(getHashKey(entityMetadata.getTableName(), rowKey), relation);

                }
            }

        }
        /*
         * Response<Map<String, String>> fields = null; if (resource != null &&
         * resource.isActive()) { fields = ((Transaction)
         * connection).hgetAll(getHashKey(entityMetadata.getTableName(),
         * rowKey)); if (connection != null) { ((Pipeline) connection).sync(); }
         * for (String field : fields.get().keySet()) { ((Transaction)
         * connection).hdel(getHashKey(entityMetadata.getTableName(), rowKey),
         * field); } } else { fields = ((Pipeline)
         * connection).hgetAll(getHashKey(entityMetadata.getTableName(),
         * rowKey)); if (connection != null) { ((Pipeline) connection).sync(); }
         * for (String field : fields.get().keySet()) { ((Pipeline)
         * connection).hdel(getHashKey(entityMetadata.getTableName(), rowKey),
         * field); } }
         */
    }
590311
public function leftJoinOn($table, $where)
    {
        $where = func_get_args();
        $table = array_shift($where);

        $this->join[] = [self::LEFT, $table, $where, false];

        return $this;
    }
308093
public function removeReverseFieldRelations($contentId)
    {
        $query = $this->dbHandler->createSelectQuery();
        $query
            ->select('ezcontentobject_attribute.*')
            ->from('ezcontentobject_attribute')
            ->innerJoin(
                'ezcontentobject_link',
                $query->expr->lAnd(
                    $query->expr->eq(
                        $this->dbHandler->quoteColumn('from_contentobject_id', 'ezcontentobject_link'),
                        $this->dbHandler->quoteColumn('contentobject_id', 'ezcontentobject_attribute')
                    ),
                    $query->expr->eq(
                        $this->dbHandler->quoteColumn('from_contentobject_version', 'ezcontentobject_link'),
                        $this->dbHandler->quoteColumn('version', 'ezcontentobject_attribute')
                    ),
                    $query->expr->eq(
                        $this->dbHandler->quoteColumn('contentclassattribute_id', 'ezcontentobject_link'),
                        $this->dbHandler->quoteColumn('contentclassattribute_id', 'ezcontentobject_attribute')
                    )
                )
            )
            ->where(
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('to_contentobject_id', 'ezcontentobject_link'),
                    $query->bindValue($contentId, null, PDO::PARAM_INT)
                ),
                $query->expr->gt(
                    $query->expr->bitAnd(
                        $this->dbHandler->quoteColumn('relation_type', 'ezcontentobject_link'),
                        $query->bindValue(8, null, PDO::PARAM_INT)
                    ),
                    0
                )
            );

        $statement = $query->prepare();
        $statement->execute();

        while ($row = $statement->fetch(PDO::FETCH_ASSOC)) {
            if ($row['data_type_string'] === 'ezobjectrelation') {
                $this->removeRelationFromRelationField($row);
            }

            if ($row['data_type_string'] === 'ezobjectrelationlist') {
                $this->removeRelationFromRelationListField($contentId, $row);
            }
        }
    }
806119
public function leftJoin($table, ...$criterion): self
    {
        $this->join[] = $this->joinArgumentsToJoinObject('LEFT', $table, $criterion);
        return $this;
    }
685724
public function removeField(\TechPromux\DynamicQueryBundle\Entity\MetadataField $field)
    {
        $this->fields->removeElement($field);
    }
310139
private function removeEntities()
    {
        //Keep track of the relations you have already deleted, so you don't try to delete them twice
        $deletedRelations = array();

        //Begin the database batch
        $this->beginBatch();

        foreach($this->nodeEntitiesToRemove as $node)
        {

            //Get the primary key
            $meta = $this->getMeta($node);
            $id = $meta->getPrimaryKey()->getValue($node);

            if($id)
            {
                //Grab the node from the database
                $entity = $this->client->getNode($id);

                //Delete all the nodes relations
                $relationships = $entity->getRelationships();

                foreach ($relationships as $relationship)
                {
                    //Don't delete it if it's already been deleted in this batch!
                    if(!in_array($relationship->getId(), $deletedRelations))
                    {
                        $deletedRelations[] = $relationship->getId();
                        $relationship->delete();
                    }
                }

                //Delete index information
                $class = $meta->getName();
                $index = $this->getRepository($class)->getIndex();
                $index->remove($entity);

                //Delete the node
                $entity->delete();
            }
        }

        foreach($this->relationEntitiesToRemove as $relation)
        {
            //Get the primary key
            $meta = $this->getMeta($relation);
            $id = $meta->getPrimaryKey()->getValue($relation);

            //If the relation has an id, and hasn't been deleted already in this batch, delete it!
            if($id && !in_array($id, $deletedRelations))
            {
                //Grab everyman relationship
                $entity = $this->client->getRelationship($id);

                //Delete index information
                $class = $meta->getName();
                $index = $this->getRepository($class)->getIndex();
                $index->remove($entity);

                //Delete the entity
                $entity->delete();
            }
        }

        //Commit the database batch
        $this->commitBatch();
    }