Exclude object from result

@param   ChildC2M $c2M Object to remove from the list of results

@return $this|ChildC2MQuery The current query, for fluid interface
438682
public function prune($c2M = null)
    {
        if ($c2M) {
            $this->addCond('pruneCond0', $this->getAliasedColName(C2MTableMap::COL_CATEGORY_ID), $c2M->getCategoryId(), Criteria::NOT_EQUAL);
            $this->addCond('pruneCond1', $this->getAliasedColName(C2MTableMap::COL_MEDIA_ID), $c2M->getMediaId(), Criteria::NOT_EQUAL);
            $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
        }

        return $this;
    }
899552
public function removeForeignServiceId($foreignServiceName)
    {
        /**
         * @var ForeignServiceId $foreignServiceId
         */
        foreach ($this->foreignServicesIds as $key => $foreignServiceId) {
            if ($foreignServiceId->getName() === $foreignServiceName) {
                $this->foreignServicesIds->remove($key);
            }
        }

        return $this;
    }
271980
public function addC2M(ChildC2M $l)
    {
        if ($this->collC2Ms === null) {
            $this->initC2Ms();
            $this->collC2MsPartial = true;
        }

        if (!$this->collC2Ms->contains($l)) {
            $this->doAddC2M($l);

            if ($this->c2MsScheduledForDeletion and $this->c2MsScheduledForDeletion->contains($l)) {
                $this->c2MsScheduledForDeletion->remove($this->c2MsScheduledForDeletion->search($l));
            }
        }

        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__ );
            }
        }
    }
1004156
protected function excludeOne(DataQuery $query)
    {
        $this->model = $query->applyRelation($this->relation);

        $predicate = sprintf("%s %s ?", $this->getDbName(), $this->getInverseOperator());
        $clause = [$predicate => $this->getDbFormattedValue()];

        return $this->aggregate ?
            $this->applyAggregate($query, $clause) :
            $query->where($clause);
    }
669078
public function removeChildren ()
  {
    $children       = $this->children;
    $this->children = [];
    if ($children)
      self::detachAll ($children);
    return $children;
  }
1240462
public function negate() {
		$components = array();
		foreach($this->components as $index => $component) {
			$components[$index] = -$component;
		}

		$this->components = $components;
		return $this;
	}
121236
public function exclude($keys)
    {
        if (! is_array($keys)) {
            $keys = func_get_args();
        }

        $this->exclude = array_filter($keys);

        return $this;
    }
1084076
public function exclude($exclude) {
		$this->excludeTags = array_merge($this->excludeTags, SimpleSAML_Utilities::arrayize($exclude));
	}
127502
public function unlink($relation, $primary1, $primary2)
    {
        if (is_null($this->schema)) {
            throw SystemException::forNoSchema();
        }

        $name = $this->schema->getName();
        $relations = $this->schema->getRelations();
        $table = $name . '_' . $relation;

        if (!isset($relations[$table])) {
            throw SystemException::forNoRelation($name, $relation);
        }

        $relation = $relations[$table];

        $model = $this->resource->model();
        $model[$relation['primary1']] = $primary1;
        $model[$relation['primary2']] = $primary2;

        return $model->remove($table);
    }
915483
public function exclude($iElementID = null)
    {
        if (empty($iElementID) || $this->isEmpty()) {
            return $this->returnThis();
        }

        $iElementIDKey = array_search($iElementID, $this->arElementIDList);
        if ($iElementIDKey === false) {
            return $this->returnThis();
        }

        unset($this->arElementIDList[$iElementIDKey]);

        return $this->returnThis();
    }
44196
void remove(final WComponent aChild) {
		ComponentModel model = getOrCreateComponentModel();

		if (model.getChildren() == null) {
			model.setChildren(copyChildren(getComponentModel().getChildren()));
		}

		if (model.getChildren().remove(aChild)) {
			// Deallocate children list if possible, to reduce session size.
			if (model.getChildren().isEmpty()) {
				model.setChildren(null);
			}

			// The child component has been successfully removed so clean up the context.
			aChild.reset();

			// If the parent has been set in the shared model, we must override
			// it in the session model for the component to be considered removed.
			// This unfortunately means that the model will remain in the user's session.
			if (aChild.getParent() != null && aChild instanceof AbstractWComponent) {
				((AbstractWComponent) aChild).getOrCreateComponentModel().setParent(null);
				((AbstractWComponent) aChild).removeNotify();
			}
		}
	}
569693
public function removeSecondaryResource(SecondaryResource $secondaryResource)
    {
        if ($this->secondaryResources->contains($secondaryResource)) {
            $this->secondaryResources->removeElement($secondaryResource);
        }

        return $this;
    }
936290
private function getExcludedFilter(array $filters, array $propertyParameter)
    {
        $excluded = array_key_exists('excluded', $filters) ? $filters['excluded'] : [];
        if (array_key_exists('exclude_duplicates', $propertyParameter)
            && $propertyParameter['exclude_duplicates']->getValue()
        ) {
            $excluded = array_merge($excluded, $this->referenceStore->getAll());
        }

        return $excluded;
    }
879168
public QueryBuilder exceptAll() {
        this.firstQuery = query();
        this.firstQuerySetOperation = Operation.EXCEPT;
        this.firstQueryAll = true;
        clear(false);
        return this;
    }
185590
private function excludeFamilies($xref1, $xref2, $tree_id): array
    {
        return DB::table('link AS l1')
            ->join('link AS l2', static function (JoinClause $join): void {
                $join
                    ->on('l1.l_to', '=', 'l2.l_to')
                    ->on('l1.l_type', '=', 'l2.l_type')
                    ->on('l1.l_file', '=', 'l2.l_file');
            })
            ->where('l1.l_file', '=', $tree_id)
            ->where('l1.l_type', '=', 'FAMS')
            ->where('l1.l_from', '=', $xref1)
            ->where('l2.l_from', '=', $xref2)
            ->pluck('l1.l_to')
            ->all();
    }
287936
public function clearToManyRelationship(string $relationshipName, string $identity): self
    {
        list ($intermediateTable, $primaryKey) =
            $this->getModelSchemas()->getBelongsToManyRelationship($this->getModelClass(), $relationshipName);

        $filters = [$primaryKey => [FilterParameterInterface::OPERATION_EQUALS => [$identity]]];
        $addWith = $this->expr()->andX();
        $this
            ->delete($this->quoteSingleIdentifier($intermediateTable))
            ->applyFilters($addWith, $intermediateTable, $filters);

        $addWith->count() <= 0 ?: $this->andWhere($addWith);

        return $this;
    }