public function removePart(MessagePart $part)
    {
        $parent = $part->getParent();
        if ($this !== $parent && $parent !== null) {
            return $parent->removePart($part);
        } else {
            $position = array_search($part, $this->children, true);
            if ($position !== false && is_int($position)) {
                array_splice($this->children, $position, 1);
                $this->onChange();
                return $position;
            }
        }
        return null;
    }
public function removePart(MessagePart $part)
    {
        $parent = $part->getParent();
        if ($this !== $parent && $parent !== null) {
            return $parent->removePart($part);
        } else {
            $position = array_search($part, $this->children, true);
            if ($position !== false && is_int($position)) {
                array_splice($this->children, $position, 1);
                $this->onChange();
                return $position;
            }
        }
        return null;
    }
public function removePart ( MessagePart $ part ) { $ parent = $ part -> getParent ( ) ; if ( $ this !== $ parent && $ parent !== null ) { return $ parent -> removePart ( $ part ) ; } else { $ position = array_search ( $ part , $ this -> children , true ) ; if ( $ position !== false && is_int ( $ position ) ) { array_splice ( $ this -> children , $ position , 1 ) ; $ this -> onChange ( ) ; return $ position ; } } return null ; }
Removes the child part from this part and returns its position or
null if it wasn't found.

Note that if the part is not a direct child of this part, the returned
position is its index within its parent (calls removePart on its direct
parent).

@param MessagePart $part
@return int or null if not found
Removes the child part from this part and returns its position or null if it wasn t found .