code: public function findAllNotDeletedInLastVersion(array $contentTypes = array())
      {
          $qa = $this->createAggregationQuery();
          $qa->match(
              array(
                  'deleted' => false
              )
          );
          if (!empty($contentTypes)) {
              $qa->match(
                  array('contentTypeId' => array('$in' => $contentTypes))
              );
          }
          $elementName = 'contentType';
          $this->generateLastVersionFilter($qa, $elementName);
  
          return $this->hydrateAggregateQuery($qa, $elementName, 'getContentTypeId');
      }
docs: @param array $contentTypes
  
  @return array