public function getPart($index, PartFilter $filter = null)
    {
        $parts = $this->getAllParts($filter);
        if (!isset($parts[$index])) {
            return null;
        }
        return $parts[$index];
    }
public function getPart($index, PartFilter $filter = null)
    {
        $parts = $this->getAllParts($filter);
        if (!isset($parts[$index])) {
            return null;
        }
        return $parts[$index];
    }
public function getPart ( $ index , PartFilter $ filter = null ) { $ parts = $ this -> getAllParts ( $ filter ) ; if ( ! isset ( $ parts [ $ index ] ) ) { return null ; } return $ parts [ $ index ] ; }
Returns the part at the given 0-based index, or null if none is set.

Note that the first part returned is the current part itself.  This is
often desirable for queries with a PartFilter, e.g. looking for a
MessagePart with a specific Content-Type that may be satisfied by the
current part.

@param int $index
@param PartFilter $filter
@return MessagePart
Returns the part at the given 0 - based index or null if none is set .