Webiny\Component\Entity\Attribute\Many2ManyAttribute::unlinkItem PHP Метод

unlinkItem() защищенный Метод

Unlink given item (only removes the aggregation record)
protected unlinkItem ( string | AbstractEntity $item ) : boolean
$item string | Webiny\Component\Entity\AbstractEntity
Результат boolean
    protected function unlinkItem($item)
    {
        // Convert instance to entity ID
        if ($item instanceof AbstractEntity) {
            $item = $item->id;
        }
        $sourceEntityId = $this->getParentEntity()->id;
        if ($this->isNull($sourceEntityId) || $this->isNull($item)) {
            return false;
        }
        $firstClassName = $this->extractClassName($this->getParentEntity());
        $secondClassName = $this->extractClassName($this->getEntity());
        $query = $this->arr([$firstClassName => $sourceEntityId, $secondClassName => $item])->sortKey()->val();
        $res = Entity::getInstance()->getDatabase()->delete($this->intermediateCollection, $query);
        return $res->getDeletedCount() == 1;
    }