public function preFill($contentTypes = [])
    {
        if (empty($contentTypes)) {
            $contentTypes = $this->app['config']->get('contenttypes');
            $contentTypeNames = array_keys($contentTypes);
        } else {
            $contentTypeNames = (array) $contentTypes;
        }

        /** @var \Bolt\Storage\Database\Prefill\Builder $builder */
        $builder = $this->app['prefill.builder'];
        $results = $builder->build($contentTypeNames, 5);

        $output = '';
        foreach ($results->get('created') as $contentTypeName => $titles) {
            foreach ($titles as $title) {
                $output .= Trans::__(
                    "Added to <tt>%key%</tt> '%title%'",
                    ['%key%' => $contentTypeName, '%title%' => $title['title']]
                );
                $output .= "<br>\n";
            }
        }
        foreach ($results->get('warnings') as $warnings) {
            $output .= $warnings;
        }
        foreach ($results->get('errors') as $errors) {
            $output .= $errors;
        }

        return $output;
    }
public function preFill($contentTypes = [])
    {
        if (empty($contentTypes)) {
            $contentTypes = $this->app['config']->get('contenttypes');
            $contentTypeNames = array_keys($contentTypes);
        } else {
            $contentTypeNames = (array) $contentTypes;
        }

        /** @var \Bolt\Storage\Database\Prefill\Builder $builder */
        $builder = $this->app['prefill.builder'];
        $results = $builder->build($contentTypeNames, 5);

        $output = '';
        foreach ($results->get('created') as $contentTypeName => $titles) {
            foreach ($titles as $title) {
                $output .= Trans::__(
                    "Added to <tt>%key%</tt> '%title%'",
                    ['%key%' => $contentTypeName, '%title%' => $title['title']]
                );
                $output .= "<br>\n";
            }
        }
        foreach ($results->get('warnings') as $warnings) {
            $output .= $warnings;
        }
        foreach ($results->get('errors') as $errors) {
            $output .= $errors;
        }

        return $output;
    }
public function preFill ( $ contentTypes = [ ] ) { if ( empty ( $ contentTypes ) ) { $ contentTypes = $ this -> app [ 'config' ] -> get ( 'contenttypes' ) ; $ contentTypeNames = array_keys ( $ contentTypes ) ; } else { $ contentTypeNames = ( array ) $ contentTypes ; } /** @var \Bolt\Storage\Database\Prefill\Builder $builder */ $ builder = $ this -> app [ 'prefill.builder' ] ; $ results = $ builder -> build ( $ contentTypeNames , 5 ) ; $ output = '' ; foreach ( $ results -> get ( 'created' ) as $ contentTypeName => $ titles ) { foreach ( $ titles as $ title ) { $ output .= Trans :: __ ( "Added to <tt>%key%</tt> '%title%'" , [ '%key%' => $ contentTypeName , '%title%' => $ title [ 'title' ] ] ) ; $ output .= "<br>\n" ; } } foreach ( $ results -> get ( 'warnings' ) as $ warnings ) { $ output .= $ warnings ; } foreach ( $ results -> get ( 'errors' ) as $ errors ) { $ output .= $ errors ; } return $ output ; }
Add some records with dummy content.

Only fill the contenttypes passed as parameters
If the parameters is empty, only fill empty tables

@see \Bolt\Storage\Database\\Prefill

@param array $contentTypes

@return string
Add some records with dummy content .