Método principal del comando
@author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
@version 2015-12-18
183979
public function main()
    {
        $json = \sasco\LibreDTE\Sii\Certificacion\SetPruebas::getJSON(
            file_get_contents($this->args['set'])
        );
        if (!empty($this->args['json']))
            file_put_contents($this->args['json'], $json);
        else
            echo $json;
        return 0;
    }
1363399
public function buildRelations()
    {
        $this->command->buildMethod($this->model, 'morphTo', null, $this->options);

        foreach ($this->toModels as $key => $toModel) {
            $options = $this->options;
            $options['primary_key'] = $this->options['primary_key'][$key];
            $this->command->buildMethod($toModel, 'morphMany', $this->model, $options);
        }
    }
997600
protected function _setupPrimaryAssignment()
    {
        if ($this->_primaryAssignment === null) {
            $this->_primaryAssignment = array(1 => self::PRIMARY_ASSIGNMENT_SESSION_ID);
        } else if (!is_array($this->_primaryAssignment)) {
            $this->_primaryAssignment = array(1 => (string) $this->_primaryAssignment);
        } else if (isset($this->_primaryAssignment[0])) {
            array_unshift($this->_primaryAssignment, null);

            unset($this->_primaryAssignment[0]);
        }

        if (count($this->_primaryAssignment) !== count($this->_primary)) {
            /**
             * @see Zend_Session_SaveHandler_Exception
             */
            require_once 'Zend/Session/SaveHandler/Exception.php';

            throw new Zend_Session_SaveHandler_Exception(
                "Value for configuration option '" . self::PRIMARY_ASSIGNMENT . "' must have an assignment "
              . "for each session table primary key.");
        } else if (!in_array(self::PRIMARY_ASSIGNMENT_SESSION_ID, $this->_primaryAssignment)) {
            /**
             * @see Zend_Session_SaveHandler_Exception
             */
            require_once 'Zend/Session/SaveHandler/Exception.php';

            throw new Zend_Session_SaveHandler_Exception(
                "Value for configuration option '" . self::PRIMARY_ASSIGNMENT . "' must have an assignment "
              . "for the session id ('" . self::PRIMARY_ASSIGNMENT_SESSION_ID . "').");
        }
    }
1129372
public function dispatchAction()
    {
        //pobranie kategorii
        $category = $this->_getPublishedCategoryByUri($this->uri);
        //wpięcie kategorii do głównego widoku aplikacji
        FrontController::getInstance()->getView()->category = $category;
        //klucz bufora
        $cacheKey = 'category-html-' . $category->id;
        //buforowanie dozwolone
        $bufferingAllowed = $this->_bufferingAllowed();
        //wczytanie zbuforowanej strony (dla niezalogowanych i z pustym requestem)
        if ($bufferingAllowed && (null !== $html = \App\Registry::$cache->load($cacheKey))) {
            //wysyłanie nagłówka o buforowaniu strony
            $this->getResponse()->setHeader('X-Cache', 'HIT');
            //zwrot html
            return $this->_decorateHtmlWithEditButton($html, $category);
        }
        //wysyłanie nagłówka o braku buforowaniu strony
        $this->getResponse()->setHeader('X-Cache', 'MISS');
        //przekazanie rekordu kategorii do widoku
        $this->view->category = $category;
        //renderowanie docelowej akcji
        $html = \Mmi\Mvc\ActionHelper::getInstance()->forward($this->_prepareForwardRequest($category));
        //buforowanie niedozwolone
        if (!$bufferingAllowed || 0 == $cacheLifetime = $this->_getCategoryCacheLifetime($category)) {
            //zwrot html
            return $this->_decorateHtmlWithEditButton($html, $category);
        }
        //zapis html kategorii do cache
        \App\Registry::$cache->save($html, $cacheKey, $cacheLifetime);
        //zwrot html
        return $this->_decorateHtmlWithEditButton($html, $category);
    }
1053572
private function setBasicConstants(){
        //Algunas constantes - La idea es ir sacandolas
        //PATHROOT: direccion de la carpeta del framework - definida en index.php
        define('PATHROOT', $this->getPathRoot());
        //PATHFRA: direccion de la carpeta del framework - definida en index.php
        define('PATHFRA', $this->getPathFra());    
        //PATHAPP: direccion de la carpeta de la aplicacion - definida en index.php
        define('PATHAPP', $this->getPathApp());
        //ENOLA_MODE: Indica si la aplicacion se esta ejecutando via HTTP o CLI
        if(PHP_SAPI == 'cli' || !filter_input(INPUT_SERVER, 'REQUEST_METHOD')){
            define('ENOLA_MODE', 'CLI');
        }else{
            define('ENOLA_MODE', 'HTTP');
        }
    }
233570
public function indexAction()
    {
        $out = '<pre>';

        $elementService = $this->get('phlexible_element.element_service');
        $elementtypeService = $this->get('phlexible_elementtype.elementtype_service');
        $conn = $this->get('doctrine.dbal.default_connection');
        /* @var $conn Connection */

        // elements

        $qb = $conn->createQueryBuilder()
            ->select('COUNT(e.eid)')
            ->from('element', 'e');
        $numElements = $conn->fetchColumn($qb->getSQL());

        $qb = $conn->createQueryBuilder()
            ->select('DISTINCT t.type_id')
            ->from('tree', 't')
            ->join('t', 'element', 'e', 't.type_id = e.eid')
            ->where('t.type = "element"');
        $numTreeElements = count($conn->fetchAll($qb->getSQL()));

        $qb = $conn->createQueryBuilder()
            ->select('DISTINCT t.type_id')
            ->from('teaser', 't')
            ->join('t', 'element', 'e', 't.type_id = e.eid')
            ->where('t.type = "element"');
        $numTeaserElements = count($conn->fetchAll($qb->getSQL()));

        $qb = $conn->createQueryBuilder()
            ->select('COUNT(e.eid)')
            ->from('element', 'e')
            ->where('eid NOT IN (SELECT DISTINCT type_id FROM tree WHERE type = "element")')
            ->andWhere('eid NOT IN (SELECT DISTINCT type_id FROM teaser WHERE type = "element")');
        $numUnusedElements = $conn->fetchColumn($qb->getSQL());

        $qb = $conn->createQueryBuilder()
            ->select('COUNT(ev.id)')
            ->from('element_version', 'ev');
        $numElementVersions = $conn->fetchColumn($qb->getSQL());

        $qb = $conn->createQueryBuilder()
            ->select(['ev.eid, COUNT(ev.eid) AS cnt'])
            ->from('element_version', 'ev')
            ->groupBy('ev.eid')
            ->orderBy('cnt', 'DESC');
        $numGroupedElementVersions = [];
        foreach ($conn->fetchAll($qb->getSQL()) as $row) {
            $numGroupedElementVersions[$row['eid']] = $row['cnt'];
        }

        // elementtypes

        $qb = $conn->createQueryBuilder()
            ->select('COUNT(et.id)')
            ->from('elementtype', 'et');
        $numElementTypes = $conn->fetchColumn($qb->getSQL());

        $qb = $conn->createQueryBuilder()
            ->select('COUNT(et.id)')
            ->from('elementtype', 'et')
            ->where('et.id NOT IN (SELECT DISTINCT element_type_id FROM element)')
            ->where('et.id NOT IN (SELECT DISTINCT reference_id FROM elementtype_structure)');
        $numUnusedElementTypes = $conn->fetchColumn($qb);

        $qb = $conn->createQueryBuilder()
            ->select('COUNT(etv.id)')
            ->from('elementtype_version', 'etv');
        $numElementTypeVersions = $conn->fetchColumn($qb->getSQL());

        $qb = $conn->createQueryBuilder()
            ->select(['etv.elementtype_id', 'COUNT(etv.id) AS cnt'])
            ->from('elementtype_version', 'etv')
            ->groupBy('etv.elementtype_id')
            ->orderBy('cnt', 'DESC');
        $numGroupedElementTypeVersions = [];
        foreach ($conn->fetchAll($qb->getSQL()) as $row) {
            $numGroupedElementTypeVersions[$row['elementtype_id']] = $row['cnt'];
        }

        $qb = $conn->createQueryBuilder()
            ->select(['et.id', 'COUNT(e.eid) AS cnt'])
            ->from('elementtype', 'et')
            ->leftJoin('et', 'element', 'e', 'e.elementtype_id = et.id')
            ->groupBy('et.id')
            ->orderBy('cnt', 'DESC');
        $numGroupedElementTypeElements = [];
        foreach ($conn->fetchAll($qb->getSQL()) as $row) {
            $numGroupedElementTypeElements[$row['id']] = $row['cnt'];
        }

        $out .= '##### Elements ############################################'.PHP_EOL;
        $out .= PHP_EOL;
        $out .= $numElements.' elements'.PHP_EOL;
        $out .= PHP_EOL;
        $out .= $numTreeElements.' tree elements'.PHP_EOL;
        $out .= $numTeaserElements.' teaser elements'.PHP_EOL;
        $out .= PHP_EOL;
        $out .= ($numTreeElements + $numTeaserElements).' used elements'.PHP_EOL;
        $out .= $numUnusedElements.' unused elements'.PHP_EOL;
        $out .= '(= '.($numTreeElements + $numTeaserElements + $numUnusedElements).' elements)'.PHP_EOL;
        $out .= PHP_EOL;
        $out .= $numElementVersions.' element versions'.PHP_EOL;
        $out .= PHP_EOL;
        $out .= 'Top 5 most element versions:'.PHP_EOL;
        $i = 0;
        foreach ($numGroupedElementVersions as $eid => $count) {
            if ($i >= 5) {
                break;
            }
            $element = $elementService->findElement($eid);
            $elementVersion = $elementService->findLatestElementVersion($element);
            $out .= '  '.str_pad($elementVersion->getBackendTitle('de', 'en').' ['.$eid.']', 40, ' ')
                .' => '.str_pad($count, 4, ' ', STR_PAD_LEFT).' versions'.PHP_EOL;
            ++$i;
        }
        $out .= PHP_EOL;
        $out .= '##### Element Types #######################################'.PHP_EOL;
        $out .= PHP_EOL;
        $out .= $numElementTypes.' element types'.PHP_EOL;
        $out .= $numUnusedElementTypes.' unused element types'.PHP_EOL;
        $out .= PHP_EOL;
        $out .= $numElementTypeVersions.' element type versions'.PHP_EOL;
        $out .= PHP_EOL;
        $out .= 'Top 5 most element type versions:'.PHP_EOL;
        $i = 0;
        foreach ($numGroupedElementTypeVersions as $etId => $count) {
            if ($i >= 5) {
                break;
            }
            $elementtype = $elementtypeService->findElementtype($etId);
            $out .= '  '.str_pad($elementtype->getTitle().' ['.$etId.']', 40, ' ')
                .' => '.str_pad($count, 4, ' ', STR_PAD_LEFT).' versions'.PHP_EOL;
            ++$i;
        }
        $out .= PHP_EOL;
        $out .= 'Top 5 most element types by elements:'.PHP_EOL;
        $i = 0;
        foreach ($numGroupedElementTypeElements as $etId => $count) {
            if ($i >= 5) {
                break;
            }
            $elementtype = $elementtypeService->findElementtype($etId);
            $out .= '  '.str_pad($elementtype->getTitle().' ['.$etId.']', 40, ' ').' => '
                .str_pad($count, 4, ' ', STR_PAD_LEFT).' elements'.PHP_EOL;
            ++$i;
        }

        return new Response($out);
    }
186114
public function perform() 
	{	
		// set the input
		if ( !is_null( $this->input ) ) 
		{
			CCIn::instance( $this->input );
		} else {
			CCIn::instance( CCServer::instance() );
		}
		
		// set current request
		static::$_current =& $this;
		
		// route is invalid show 404
		if ( !$this->route instanceof CCRoute ) 
		{
			$this->route = CCRouter::resolve( '#404' );
		}
		
		/*
		 * call wake events
		 * if one event returns an response all other calls will be skipped also events!
		 */
		foreach( CCRouter::events_matching( 'wake', $this->route->uri ) as $callback )
		{
			if ( ( $return = CCContainer::call( $callback ) ) instanceof CCResponse )
			{
				$this->response = $return; return $this;
			}
		}
		
		/*
		 * a closure
		 */
		if ( !is_array( $this->route->callback ) && is_callable( $this->route->callback ) ) 
		{	
			// execute and capture the output
			ob_start();
			// run the closure 
			$return = call_user_func_array( $this->route->callback, $this->route->params );
			// catch the output
			$output = ob_get_clean();
			
			// do we got a response?
			if ( !$return instanceof CCResponse ) 
			{
				// if not create one with the captured output
				$return = CCResponse::create( $output );
			}
		}
		/*
		 * a callback
		 */
		elseif ( is_callable( $this->route->callback ) )
		{
			// execute the callback and get the return
			$return = call_user_func_array( $this->route->callback, array( $this->route->action, $this->route->params ) );
			
			// do we got a response?
			if ( !$return instanceof CCResponse ) 
			{
				// if not create one with the return as string
				$return = CCResponse::create( (string) $return );
			}
		}
		/*
		 * 404 error if nothing
		 */
		else 
		{
			$return = CCResponse::error( 404 );
		}
		
		// set the response
		$this->response = $return;
		
		/*
		 * call sleep events
		 * if one event returns an response all other calls will be skipped also events!
		 */
		foreach( CCRouter::events_matching( 'sleep', $this->route->uri ) as $callback )
		{
			if ( $return = CCContainer::call( $callback, $this->response ) instanceof CCResponse )
			{
				$this->response = $return; return $this;
			}
		}
		
		return $this;
	}
29524
public function editAction()
    {
        $form = new \CmsAdmin\Form\Text(new \Cms\Orm\CmsTextRecord($this->id));
        $this->view->textForm = $form;
        //brak wysłanych danych
        if (!$form->isMine()) {
            return;
        }
        //zapisany
        if ($form->isSaved()) {
            $this->getMessenger()->addMessage('messenger.text.text.saved', true);
            $this->getResponse()->redirect('cmsAdmin', 'text');
        }
        $this->getMessenger()->addMessage('messenger.text.text.error', false);
    }
1128862
public function execute()
    {
        /** @var $composer \Composer\Composer */
        $composer = $this->getComposer();
        $io = $this->getIO();
        $config = $composer->getConfig();

        $optimize = $this->getOptions()->optimizeAutoloader() || $config->get('optimize-autoloader');
        $authoritative = $this->getOptions()->classmapAuthoritative() || $config->get('classmap-authoritative');

        $install = Installer::create($io, $composer)
            ->setDryRun($this->getOptions()->dryRun())
            ->setVerbose($this->getOptions()->verbose())
            ->setPreferSource($this->getOptions()->preferSource())
            ->setPreferDist($this->getOptions()->preferDist())
            ->setDevMode(!$this->getOptions()->noDev())
            ->setDumpAutoloader(!$this->getOptions()->noAutoloader())
            ->setRunScripts(!$this->getOptions()->noScripts())
            ->setOptimizeAutoloader($optimize)
            ->setClassMapAuthoritative($authoritative)
            ->setIgnorePlatformRequirements($this->getOptions()->ignorePlatformReqs())
        ;

        try {
            return $install->run();
        } catch (\Exception $e) {
            $msg = sprintf('%s received an error from Composer: %s in %s::%s', __METHOD__, $e->getMessage(), $e->getFile(), $e->getLine());
            $this->app['logger.system']->critical($msg, ['event' => 'exception', 'exception' => $e]);
            throw new PackageManagerException($e->getMessage(), $e->getCode(), $e);
        }
    }
570992
public function indexAction()
    {
        $currentAccount = $this->securityContext->getAccount();
        $userWorkspace = $this->workspaceRepository->findOneByName(UserUtility::getPersonalWorkspaceNameForUsername($currentAccount->getAccountIdentifier()));
        /** @var Workspace $userWorkspace */

        $workspacesAndCounts = [
            $userWorkspace->getName() => [
                'workspace' => $userWorkspace,
                'changesCounts' => $this->computeChangesCount($userWorkspace),
                'canPublish' => false,
                'canManage' => false,
                'canDelete' => false
            ]
        ];

        foreach ($this->workspaceRepository->findAll() as $workspace) {
            /** @var Workspace $workspace */
            // FIXME: This check should be implemented through a specialized Workspace Privilege or something similar
            if (!$workspace->isPersonalWorkspace() && ($workspace->isInternalWorkspace() || $this->userService->currentUserCanManageWorkspace($workspace))) {
                $workspacesAndCounts[$workspace->getName()]['workspace'] = $workspace;
                $workspacesAndCounts[$workspace->getName()]['changesCounts'] = $this->computeChangesCount($workspace);
                $workspacesAndCounts[$workspace->getName()]['canPublish'] = $this->userService->currentUserCanPublishToWorkspace($workspace);
                $workspacesAndCounts[$workspace->getName()]['canManage'] = $this->userService->currentUserCanManageWorkspace($workspace);
                $workspacesAndCounts[$workspace->getName()]['dependentWorkspacesCount'] = count($this->workspaceRepository->findByBaseWorkspace($workspace));
            }
        }

        $this->view->assign('userWorkspace', $userWorkspace);
        $this->view->assign('workspacesAndChangeCounts', $workspacesAndCounts);
    }
1347604
public function request(){        
        //Cargo el modulo correspondiente en base al tipo de requerimiento
        if(ENOLA_MODE == 'HTTP'){
            //Cargo el modulo Http
            $this->loadHttpModule();
        }else{
            //Cargo el modulo Cron
            $this->loadCronModule();
        }        
        //Luego de la carga de todos los modulos creo una instancia de Support\View
        $this->view= new Support\View();
        //Cargo la configuracion del usuario
        $this->loadUserConfig();
        //Analizo si estoy en modo HTTP o CLI
        if(ENOLA_MODE == 'HTTP'){
            //Ejecuto el controlador correspondiente
            $this->httpCore->executeHttpRequest();
        }else{
            //Ejecuta el cron controller
            $this->cronCore->executeCronController();
        }        
    }
102904
public static function comanda ( $comanda_id )
    {
    	debug( $comanda_id );die("asas");
        $Comanda = ClassRegistry::init('Comanda.Comanda');

		$productos_x_comanda = array();
		// se supone que en una comanda yo no voy a tener productos que se impriman en comanderas distitas
		// (esto es separado desde el mismo controlador y se manda aimprimir a comandas diferentes)
		// pero , por las dudas que ésto suceda, cuando yo listo los productos de una comanda, me los separa para ser impreso en Comanderas distintas
		// Entonces, por lo genral (SIEMPRE) se imprimiria x 1 sola Comandera en este método del Componente

		$comanderas_involucradas = $Comanda->comanderas_involucradas($comanda_id);

		$entradas = $Comanda->listado_de_productos_con_sabores($comanda_id, DETALLE_COMANDA_TRAER_ENTRADAS);
		$platos_principales = $Comanda->listado_de_productos_con_sabores($comanda_id, DETALLE_COMANDA_TRAER_PLATOS_PRINCIPALES);

		$productos = array_merge($entradas, $platos_principales);

		// genero el array lindo paraimprimir por cada comanda
		// o sea, genero un renglón de la comanda
		// por ejmeplo me queraria algo asi:
		// "1) Milanesa de pollo\n"
		foreach($comanderas_involucradas as $printer_id):
			Printaitor::send(array(
				'productos' => $productos,
				'entradas' => $entradas,
				),
				$printer_id,
				'comandas' // user vista comandas.ctp
		);
		endforeach;
    }
700905
public function execute() {
        
//        echo '<br>';
//        echo 'Se han encontrado '.$this->resFilter->lenght().' resultados del segundo filtro <br>';
        
        //Ejecutar controlador raiz por defecto, si no hay ningun resultado posible.
        if ($this->resFilter->isEmpty() && $this->rutesManager->isRoot($this->actual, $this->peticion)) {
            $this->root();
            return;
        }
        
        //Ejecutar controlador por defecto, si no hay ningun resultado posible.
        if ($this->resFilter->isEmpty()) {
            $this->default();
            return;
        }
 
        //Ejecutar controlador.
        $this->resFilter->each(function (HttpCallBack $call) {
     
            $call->call($this->rutesManager->getParameter());
            
        });

    }
310072
public function handleRequest()
    {
        //obsługa danych z POST
        $post = FrontController::getInstance()->getRequest()->getPost();
        //brak posta
        if ($post->isEmpty()) {
            return;
        }
        //niedozwolone na ACL (w edycji na polu operacje)
        if ($this->_checkbox->getGrid()->getColumn('_operation_') && !(new AclAllowed)->aclAllowed($this->_checkbox->getGrid()->getColumn('_operation_')->getOption('editParams'))) {
            return;
        }
        if ($this->_changeRecord($post)) {
            exit;
        }
    }
937502
public function run()
    {
        DB::table('user__roles')->delete();

        $admin = DB::table('user__roles')->insertGetId([
            'name'         => 'admin',
            'display_name' => 'Site Administrator',
            'description'  => 'User is allowed to manage the full site',
            'created_at'   => Carbon::now(),
            'updated_at'   => Carbon::now(),

        ]);

        $user = EloquentUser::where('email', '=', 'admin@societycms.com')->first();

        $user->roles()->attach($admin);

        DB::table('user__roles')->insert([
            'name'         => 'owner',
            'display_name' => 'Project Owner',
            'description'  => 'User is the owner of a given project',
            'created_at'   => Carbon::now(),
            'updated_at'   => Carbon::now(),
        ]);
    }
434651
public function run()
    {
        DB::table('users')->insert([
            ['id' => '1', 'email' => 'webmaster@chilcanoweb.com', 'password' => bcrypt('admin'), 'estado' => '1']
        ]);

        DB::table('user_profiles')->insert([
            [
                'id' => '1',
                'user_id' => '1',
                'nombres' => 'Administrador',
                'apellidos' => 'ChilcanoWeb',
                'descripcion' => 'Administrador',
                'imagen' => 'admin.png',
                'imagen_carpeta' => 'carpeta/'
            ]
        ]);

        //AJUSTES
        DB::table('configuracion')->insert([
            ['tipo' => 'admin', 'nombre' => 'logo', 'etiqueta' => 'Logo', 'valor' => 'logo-admin.png', 'contenido' => '{"imagen_carpeta": "carpeta/"}'],

	        ['tipo' => 'redes-sociales', 'nombre' => 'facebook', 'etiqueta' => 'Facebook', 'valor' => 'https://www.facebook.com/', 'contenido' => '{"icono": "socicon-facebook", "color": "#3e5b98"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'google', 'etiqueta' => 'Google+', 'valor' => '', 'contenido' => '{"icono": "socicon-googleplus", "color": "#dd4b39"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'instagram', 'etiqueta' => 'Instagram', 'valor' => '', 'contenido' => '{"icono": "socicon-instagram", "color": "#000000"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'linkedin', 'etiqueta' => 'Linkedin', 'valor' => 'https://www.linkedin.com/', 'contenido' => '{"icono": "socicon-linkedin", "color": "#3371b7"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'pinterest', 'etiqueta' => 'Pinterest', 'valor' => '', 'contenido' => '{"icono": "socicon-pinterest", "color": "#c92619"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'skype', 'etiqueta' => 'Skype', 'valor' => '', 'contenido' => '{"icono": "socicon-skype", "color": "#28abe3"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'tumblr', 'etiqueta' => 'Tumblr', 'valor' => '', 'contenido' => '{"icono": "socicon-tumblr", "color": "#45556c"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'twitter', 'etiqueta' => 'Twitter', 'valor' => '', 'contenido' => '{"icono": "socicon-twitter", "color": "#4da7de"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'vimeo', 'etiqueta' => 'Vimeo', 'valor' => '', 'contenido' => '{"icono": "socicon-vimeo", "color": "#51b5e7"}'],
	        ['tipo' => 'redes-sociales', 'nombre' => 'youtube', 'etiqueta' => 'Youtube', 'valor' => '', 'contenido' => '{"icono": "socicon-youtube", "color": "#e02a20"}'],

            ['tipo' => 'web', 'nombre' => 'titulo', 'etiqueta' => 'Titulo', 'valor' => 'Empresa', 'contenido' => ''],
            ['tipo' => 'web', 'nombre' => 'dominio', 'etiqueta' => 'Dominio', 'valor' => 'http://empresa.dev/', 'contenido' => ''],
            ['tipo' => 'web', 'nombre' => 'logo', 'etiqueta' => 'Logo', 'valor' => 'logo.png', 'contenido' => '{"imagen_carpeta": "carpeta/"}'],
            ['tipo' => 'web', 'nombre' => 'keywords', 'etiqueta' => 'Palabras clave', 'valor' => '', 'contenido' => ''],
            ['tipo' => 'web', 'nombre' => 'description', 'etiqueta' => 'Descripción', 'valor' => '', 'contenido' => ''],
            ['tipo' => 'web', 'nombre' => 'google-analytics', 'etiqueta' => 'Google Analytics', 'valor' => '', 'contenido' => ''],

            ['tipo' => 'footer', 'nombre' => 'direccion', 'etiqueta' => 'Dirección', 'valor' => 'Av. Mi Empresa 123 - Lima, Perú', 'contenido' => ''],
            ['tipo' => 'footer', 'nombre' => 'datos', 'etiqueta' => 'Datos', 'valor' => '+51999888777 | 123-4567', 'contenido' => ''],

            ['tipo' => 'contacto', 'nombre' => 'titulo', 'etiqueta' => 'Titulo', 'valor' => 'Contacto', 'contenido' => ''],
            ['tipo' => 'contacto', 'nombre' => 'descripcion', 'etiqueta' => 'Descripcion', 'valor' => 'Duis aute irure dolor in reprehenderit in', 'contenido' => ''],
            ['tipo' => 'contacto', 'nombre' => 'mensaje-enviado', 'etiqueta' => 'Mensaje de Éxito', 'valor' => 'Tu mensaje fue enviado con éxito', 'contenido' => ''],
        ]);
    }
902953
public function cmdAddOrder()
    {
        $submitted = $this->getParam();

        $this->setSubmitted(null, $submitted);
        $this->setSubmittedJson('data');

        $this->validateComponent('order');

        if ($this->isError()) {
            $this->output();
        }

        $id = $this->order->add($this->getSubmitted());

        if (empty($id)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        $this->line($id);
        $this->output();
    }