Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
webbingbrasil/themes-module / Console / ListCommand.php
Size: Mime:
<?php

namespace Modules\Themes\Console;

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;

class ListCommand extends Command
{
    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'themes:list';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Show list of all themes.';

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function fire()
    {
        $this->table(['Name', 'Description', 'Type', 'Path'], $this->getRows());
    }

    /**
     * Get table rows.
     *
     * @return array
     */
    public function getRows()
    {
        $rows = [];

        foreach ($this->getThemes() as $themes) {
            $rows[] = [
                $themes->getName(),
                $themes->getDescription(),
                $themes->getType(),
                $themes->getPath(),
            ];
        }

        return $rows;
    }

    /**
     * @return \Modules\Themes\Theme\Theme[]
     */
    public function getThemes()
    {
        return \Themes::themes();
    }

    /**
     * Get the console command options.
     *
     * @return array
     */
    protected function getOptions()
    {
        return array(
            array('only', null, InputOption::VALUE_OPTIONAL, 'Types of modules will be displayed.', null),
            array('direction', 'd', InputOption::VALUE_OPTIONAL, 'The direction of ordering.', 'asc'),
        );
    }
}