Generate a subtitle, based on filter parameters

@param int    $count
@param Date   $start
@param Date   $end
@param string $placename

@return string
344179
protected function subtitle(int $count, Date $start, Date $end, string $placename): string
    {
        if ($start->isOK() && $end->isOK() && $placename !== '') {
            return I18N::plural(
                '%s individual with events in %s between %s and %s',
                '%s individuals with events in %s between %s and %s',
                $count,
                I18N::number($count),
                $placename,
                $start->display(false, '%Y'),
                $end->display(false, '%Y')
            );
        }

        if ($placename !== '') {
            return I18N::plural(
                '%s individual with events in %s',
                '%s individuals with events in %s',
                $count,
                I18N::number($count),
                $placename
            );
        }

        if ($start->isOK() && $end->isOK()) {
            return I18N::plural(
                '%s individual with events between %s and %s',
                '%s individuals with events between %s and %s',
                $count,
                I18N::number($count),
                $start->display(false, '%Y'),
                $end->display(false, '%Y')
            );
        }

        return I18N::plural('%s individual', '%s individuals', $count, I18N::number($count));
    }
601437
public function getBetween($content, $start, $end = null)
    {
        return $this->api->getBetween($content, $start, $end);
    }
560967
public function getContent($count, $format = 'html', $loremipsum = true)
    {
        $format = mb_strtolower($format);

        if ($count <= 0) {
            return '';
        }

        switch ($format) {
            case 'txt':
                return $this->getText($count, $loremipsum);
            case 'plain':
                return $this->getPlain($count, $loremipsum);
            default:
                return $this->getHTML($count, $loremipsum);
        }
    }
104605
protected function eol(string $str, string $eol = '', int $count = null):string{
		return str_replace($this->options->placeholder_eol, $eol, $str, $count);
	}
30968
protected function getAlterMigrationName($name, $count)
    {
        $filename = sprintf('%s_alter_%s_table_%s.php', date('Y_m_d_His'), strtolower($name), $count);

        return Helpers::postFixWith($filename, '.php');
    }
664880
private function findContentsByCriteria(array $classnames, $start, $count)
    {
        $criterias = array_merge([
            'only_online' => false,
            'site_uid'    => $this->getApplication()->getSite()->getUid(),
        ], $this->getRequest()->query->all());

        $criterias['only_online'] = (boolean) $criterias['only_online'];
        $preserveOrder = isset($criterias['preserve_order']) ? (boolean) $criterias['preserve_order'] : false;

        $order_infos = [
            'column'    => isset($criterias['order_by']) ? $criterias['order_by'] : '_modified',
            'direction' => isset($criterias['order_direction']) ? $criterias['order_direction'] : 'desc',
        ];

        $pagination = ['start' => $start, 'limit' => $count];

        unset($criterias['order_by']);
        unset($criterias['order_direction']);

        $criterias['contentIds'] = array_filter(explode(',', $this->getRequest()->query->get('uids', '')));

        unset($criterias['uids']);
        unset($criterias['preserve_order']);

        $contents = $this->getEntityManager()
            ->getRepository('BackBee\ClassContent\AbstractClassContent')
            ->findContentsBySearch($classnames, $order_infos, $pagination, $criterias)
        ;

        if ($preserveOrder === true) {
            $contents = $this->sortByUids($criterias['contentIds'], $contents);
        }

        foreach ($contents as $content) {
            $content->setDraft($this->getClassContentManager()->getDraft($content));
        }

        return $contents;
    }
64224
public function substring($start, $end = null) {
		$length = $this->length();
		if ($end < 0) {
			$end = $length + $end;
		}
		$end = $end !== null ? min($end, $length) : $length;
		$start = min($start, $end);
		$end = max($start, $end);
		$end = $end - $start;

		return new Text(mb_substr($this->string, $start, $end, $this->encoding), $this->encoding);
	}
234521
public function createdAt($start = null, $end = null)
    {
        /* @var $this ActiveQuery */
        $model = $this->noInitModel;
        if (!is_string($model->createdAtAttribute) || empty($model->createdAtAttribute)) {
            return $this;
        }
        return static::range($this, $model->createdAtAttribute, $start, $end);
    }
126028
public function stream_read( $count )
    {
        $ret = substr( $this->string, $this->position, $count );
        $this->position += strlen( $ret );
        return $ret;
    }
1267752
public function endListValues($tableName, $count = 0)
    {
        if ($this->dumpSettings['disable-keys']) {
            $this->compressManager->write(
                $this->typeAdapter->end_add_disable_keys($tableName)
            );
        }

        if ($this->dumpSettings['add-locks']) {
            $this->compressManager->write(
                $this->typeAdapter->end_add_lock_table($tableName)
            );
        }

        if ($this->dumpSettings['single-transaction']) {
            $this->dbHandler->exec($this->typeAdapter->commit_transaction());
        }

        if ($this->dumpSettings['lock-tables']) {
            $this->typeAdapter->unlock_table($tableName);
        }

        // Commit to enable autocommit
        if ($this->dumpSettings['no-autocommit']) {
            $this->compressManager->write(
                $this->typeAdapter->end_disable_autocommit()
            );
        }

        $this->compressManager->write(PHP_EOL);

        if (!$this->dumpSettings['skip-comments']) {
            $this->compressManager->write(
                "-- Dumped table `".$tableName."` with $count row(s)".PHP_EOL.
                '--'.PHP_EOL.PHP_EOL
            );
        }

        return;
    }
1218346
public function getFormattedDate($format, $startDate = true)
    {
        $date = $this->getEndDate();

        // Start date should be formatted?
        if ($startDate) {
            $date = $this->getStartDate();
        }

        // Unknown date or format is invalid?
        // Nothing to do
        if (null === $date || !Date::isValidDateFormat($format)) {
            return '';
        }

        return $date->format($format);
    }
1176380
public function getBetween($content, $start, $end = null)
    {
        $startIndex = strpos($content, $start) + strlen($start);
        if ($startIndex === false) {
            return false;
        }

        if (!$end) {
            return substr($content, $startIndex);
        }

        $length = strpos($content, $end, $startIndex);
        if ($length === false) {
            return false;
        }

        return substr($content, $startIndex, $length - $startIndex);
    }
833009
public static function createFromStartEnd(CalendarDate $start, CalendarDate $end, $recurrence = null)
    {
        return static::create($start, null, Interval::create($start, $end)->duration(), $recurrence);
    }
1312009
private function getLanguagesCountFromSessions($start, $end)
    {
        return $this->getCachedVisitors()
            ->filter(function (Visitor $visitor) use ($start, $end) {
                return $visitor->updated_at->between($start, $end) && ! is_null($visitor->language);
            })
            ->transform(function (Visitor $visitor) {
                return $visitor->language;
            })
            ->groupBy('preference')
            ->transform(function (Collection $items, $key) {
                return [
                    'name'  => $key,
                    'count' => $items->count(),
                ];
            })
            ->sortByDesc('count');
    }
584371
public function outputFileCount(int $count): void
    {
        if (OutputInterface::VERBOSITY_NORMAL === $this->io->getVerbosity()) {
            $this->progressBar = $this->io->createProgressBar($count);
            $this->progressBar->start();
        } elseif ($this->io->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
            $this->progressBar = new ProgressBar(new NullOutput());
        }
    }
760799
public function substring($start, $end = null)
    {
        if ($end === null) {
            return substr($this->content, $start);
        }
        $len = $end - $start;
        if ($len < 0) {
            return '';
        }
        return substr($this->content, $start, $len);
    }
451300
private function getStatementContentSince(DateTime $since, $count = false)
    {
        $q = $this->connection->createQueryBuilder()
            ->select($count ? 'count(c.id)' : 'c.id')
            ->from('ezcontentobject', 'c')
            ->where('c.status = :status')->andWhere('c.modified >= :since')
            ->orderBy('c.modified')
            ->setParameter('status', ContentInfo::STATUS_PUBLISHED, PDO::PARAM_INT)
            ->setParameter('since', $since->getTimestamp(), PDO::PARAM_INT);

        return $q->execute();
    }