public function unsetSubContent(AbstractClassContent $subContent)
    {
        foreach ($this->_data as $key => $value) {
            if (is_array($value)) {
                $totalContent = count($value);
                foreach ($value as $cKey => $cValue) {
                    $contentUid = $cValue;
                    if (is_array($cValue)) {
                        $contentUid = array_values($cValue);
                        $contentUid = end($contentUid);
                    }

                    if ($subContent->getUid() == $contentUid) {
                        if (1 === $totalContent) {
                            $this->_data[$key] = [];
                            $this->_subcontent->removeElement($subContent);
                        } else {
                            unset($value[$cKey]);
                            $this->_data[$key] = $value;
                        }
                    }
                }
            }
        }

        return $this;
    }
public function unsetSubContent(AbstractClassContent $subContent)
    {
        foreach ($this->_data as $key => $value) {
            if (is_array($value)) {
                $totalContent = count($value);
                foreach ($value as $cKey => $cValue) {
                    $contentUid = $cValue;
                    if (is_array($cValue)) {
                        $contentUid = array_values($cValue);
                        $contentUid = end($contentUid);
                    }

                    if ($subContent->getUid() == $contentUid) {
                        if (1 === $totalContent) {
                            $this->_data[$key] = [];
                            $this->_subcontent->removeElement($subContent);
                        } else {
                            unset($value[$cKey]);
                            $this->_data[$key] = $value;
                        }
                    }
                }
            }
        }

        return $this;
    }
public function unsetSubContent ( AbstractClassContent $ subContent ) { foreach ( $ this -> _data as $ key => $ value ) { if ( is_array ( $ value ) ) { $ totalContent = count ( $ value ) ; foreach ( $ value as $ cKey => $ cValue ) { $ contentUid = $ cValue ; if ( is_array ( $ cValue ) ) { $ contentUid = array_values ( $ cValue ) ; $ contentUid = end ( $ contentUid ) ; } if ( $ subContent -> getUid ( ) == $ contentUid ) { if ( 1 === $ totalContent ) { $ this -> _data [ $ key ] = [ ] ; $ this -> _subcontent -> removeElement ( $ subContent ) ; } else { unset ( $ value [ $ cKey ] ) ; $ this -> _data [ $ key ] = $ value ; } } } } } return $ this ; }
Unsets a subcontent to the current collection.

@param \BackBee\ClassContent\AbstractClassContent $subContent

@return \BackBee\ClassContent\AbstractClassContent
Unsets a subcontent to the current collection .