Se añade version 1.0 de parser html

correciones menores a codigo anterior realizado.
Se añade html de prueba
Se añaden librerias de restapi
parent 8ea2da10
......@@ -16,9 +16,14 @@ class AppKernel extends Kernel
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new Propel\PropelBundle\PropelBundle(),
new FOS\RestBundle\FOSRestBundle(),
new JMS\SerializerBundle\JMSSerializerBundle(),
new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
new Nelmio\CorsBundle\NelmioCorsBundle(),
new AppBundle\AppBundle(),
new BackendBundle\BackendBundle(),
new CampaniaBundle\CampaniaBundle(),
new WsBundle\WsBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
......
......@@ -23,7 +23,7 @@
</li>
<li class="menu-item " aria-haspopup="true" >
<a href="{{path('campania_listado')}}" class="menu-link "><i class="menu-bullet menu-bullet-line"><span></span></i>
<span class="menu-text">Listado Campaña</span></a>
<span class="menu-text">Listado Campañas</span></a>
</li>
{%if is_granted('ROLE_ADMIN')%}
<li class="menu-item " aria-haspopup="true" >
......
<html>
<body>
{%set fila =0, filaAux = 0%}
{%for contenido as contenidosHead%}
{%if fila != contenido.fila%}
{%set fila = contenido.fila, filaAux = contenido.fila%}
{%if loop.first%}<div class="row" id="{{contenido.getFila()}}">{%else%}</div><div class="row" id="{{contenido.getFila()}}">{%endif%}
{{contenido.contenido}}
{%else%}
{{contenido.contenido}}
{%endif%}
{%endfor%}
</body>
</html>
......@@ -439,11 +439,13 @@ class SymfonyRequirements extends RequirementCollection
'Change the permissions of either "<strong>app/logs/</strong>" or "<strong>var/logs/</strong>" directory so that the web server can write into it.'
);
$this->addPhpIniRequirement(
'date.timezone', true, false,
'date.timezone setting must be set',
'Set the "<strong>date.timezone</strong>" setting in php.ini<a href="#phpini">*</a> (like Europe/Paris).'
);
if (version_compare($installedPhpVersion, '7.0.0', '<')) {
$this->addPhpIniRequirement(
'date.timezone', true, false,
'date.timezone setting must be set',
'Set the "<strong>date.timezone</strong>" setting in php.ini<a href="#phpini">*</a> (like Europe/Paris).'
);
}
if (false !== $requiredPhpVersion && version_compare($installedPhpVersion, $requiredPhpVersion, '>=')) {
$this->addRequirement(
......@@ -624,12 +626,6 @@ class SymfonyRequirements extends RequirementCollection
'Install and enable the <strong>mbstring</strong> extension.'
);
$this->addRecommendation(
function_exists('iconv'),
'iconv() should be available',
'Install and enable the <strong>iconv</strong> extension.'
);
$this->addRecommendation(
function_exists('utf8_decode'),
'utf8_decode() should be available',
......@@ -684,6 +680,21 @@ class SymfonyRequirements extends RequirementCollection
'Upgrade your <strong>intl</strong> extension with a newer ICU version (4+).'
);
if (class_exists('Symfony\Component\Intl\Intl')) {
$this->addRecommendation(
\Symfony\Component\Intl\Intl::getIcuDataVersion() <= \Symfony\Component\Intl\Intl::getIcuVersion(),
sprintf('intl ICU version installed on your system is outdated (%s) and does not match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()),
'To get the latest internationalization data upgrade the ICU system package and the intl PHP extension.'
);
if (\Symfony\Component\Intl\Intl::getIcuDataVersion() <= \Symfony\Component\Intl\Intl::getIcuVersion()) {
$this->addRecommendation(
\Symfony\Component\Intl\Intl::getIcuDataVersion() === \Symfony\Component\Intl\Intl::getIcuVersion(),
sprintf('intl ICU version installed on your system (%s) does not match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()),
'To avoid internationalization data inconsistencies upgrade the symfony/intl component.'
);
}
}
$this->addPhpIniRecommendation(
'intl.error_level',
create_function('$cfgValue', 'return (int) $cfgValue === 0;'),
......
......@@ -119,10 +119,14 @@ function echo_block($style, $title, $message)
echo PHP_EOL.PHP_EOL;
echo_style($style, str_repeat(' ', $width).PHP_EOL);
echo_style($style, str_pad(' ['.$title.']', $width, ' ', STR_PAD_RIGHT).PHP_EOL);
echo_style($style, str_pad($message, $width, ' ', STR_PAD_RIGHT).PHP_EOL);
echo_style($style, str_repeat(' ', $width).PHP_EOL);
echo_style($style, str_repeat(' ', $width));
echo PHP_EOL;
echo_style($style, str_pad(' ['.$title.']', $width, ' ', STR_PAD_RIGHT));
echo PHP_EOL;
echo_style($style, $message);
echo PHP_EOL;
echo_style($style, str_repeat(' ', $width));
echo PHP_EOL;
}
function has_color_support()
......
imports:
- { resource: parameters.yml }
- { resource: parameters_cors.yml }
- { resource: security.yml }
- { resource: services.yml }
- { resource: "@BackendBundle/Resources/config/services.yml" }
- { resource: "@CampaniaBundle/Resources/config/services.yml" }
- { resource: "@WsBundle/Resources/config/services.yml" }
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
......@@ -136,3 +138,31 @@ propel:
dsn: %database_driver%:host=%database_host%;dbname=%database_name%;charset=UTF8
options: {}
attributes: {}
fos_rest:
param_fetcher_listener: true
view:
view_response_listener: force
disable_csrf_role: ROLE_API
nelmio_api_doc:
name: 'Documentacion WebServices Mcafee'
nelmio_cors:
# defaults:
# allow_credentials: false
# allow_origin: []
# allow_headers: []
# allow_methods: []
# expose_headers: []
# max_age: 0
# hosts: []
# origin_regex: false
# forced_allow_origin_value: ~
paths:
'^/api/':
origin_regex: true
allow_credentials: true
allow_origin: %cors_allow_origin%
allow_headers: ['Authorization', 'X-Requested-With', 'Content-Type', 'Accept', 'Origin', 'X-Custom-Auth']
allow_methods: ['POST', 'GET']
max_age: 3600
\ No newline at end of file
......@@ -20,4 +20,5 @@ parameters:
# A secret key that's used to generate certain security-related tokens
secret: ThisTokenIsNotSoSecretChangeIt
pass_ws_userapi: ~
jms_serializer.camel_case_naming_strategy.class: ~
# This file is auto-generated during the composer install
parameters:
cors_allow_origin: ['*']
......@@ -5,3 +5,13 @@ campania:
backend:
resource: "@BackendBundle/Resources/config/routing.yml"
prefix: /backend
ws:
resource: "@WsBundle/Resources/config/routing.yml"
prefix: /api
campania_api_test:
path: test/api/test
defaults: { _controller: CampaniaBundle:Campania:cargarHtmlFront }
\ No newline at end of file
......@@ -4,6 +4,10 @@ security:
# http://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
providers:
in_memory:
memory:
users:
userApi: { password: "%pass_ws_userapi%", roles: [ 'ROLE_USER', 'ROLE_API' ] }
backend_backendusuario_provider:
id: backend_provider
......@@ -17,6 +21,11 @@ security:
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
api_ws:
pattern: ^/api/
stateless: true
http_basic:
provider: in_memory
login_backend_firewall:
pattern: ^/backend/login$
......@@ -61,9 +70,12 @@ security:
# http://symfony.com/doc/current/cookbook/security/form_login_setup.html
access_control:
- { path: ^/api/doc, roles: ROLE_API_ADMIN }
- { path: ^/api, roles: [IS_AUTHENTICATED_FULLY,ROLE_API] }
- { path: ^/backend/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/backend/*, roles: [ROLE_ADMIN, ROLE_USER, ROLE_OBSERVER]}
role_hierarchy:
ROLE_API_ADMIN: [ROLE_API]
ROLE_ADMIN: [ROLE_USER, ROLE_OBSERVER]
......@@ -85,6 +85,7 @@
<column name="fil_id" phpName="FilId" type="INTEGER" required="false"/>
<column name="cco_entorno" phpName="CcoEntorno" type="INTEGER" required="false"/>
<column name="cco_contenido" phpName="CcoContenido" type="LONGVARCHAR" required="false"/>
<column name="cco_fila" phpName="CcoFila" type="INTEGER" required="false"/>
<column name="cco_columna" phpName="CcoColumna" type="INTEGER" required="false"/>
<column name="cco_orden" phpName="CcoOrden" type="INTEGER" required="false"/>
<column name="cco_tipo" phpName="CcoTipo" type="INTEGER" required="false"/>
......@@ -223,6 +224,29 @@
<parameter name="Engine" value="InnoDB"/>
</vendor>
</table>
<table name="template_css_relacion" phpName="TemplateCssRelacion" idMethod="native">
<column name="tcr_id" phpName="TcrId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="tem_id" phpName="TemId" type="INTEGER" required="false"/>
<column name="dco_id" phpName="DcoId" type="INTEGER" required="false"/>
<column name="tcr_tipo" phpName="TcrTipo" type="INTEGER" required="false"/>
<column name="tcr_entorno" phpName="TcrEntorno" type="INTEGER" required="false"/>
<column name="tcr_clase_css" phpName="TcrClaseCss" type="VARCHAR" size="1000" required="false"/>
<foreign-key foreignTable="disposicion_columnas" name="fk_dco_id_relacion" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference local="dco_id" foreign="dco_id"/>
</foreign-key>
<foreign-key foreignTable="template" name="fk_tem_id_relacion" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference local="tem_id" foreign="tem_id"/>
</foreign-key>
<index name="fk_tem_id_relacion_idx">
<index-column name="tem_id"/>
</index>
<index name="fk_dco_id_relacion_idx">
<index-column name="dco_id"/>
</index>
<vendor type="mysql">
<parameter name="Engine" value="InnoDB"/>
</vendor>
</table>
<table name="tipo" phpName="Tipo" idMethod="native">
<column name="tip_id" phpName="TipId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="tip_nombre" phpName="TipNombre" type="VARCHAR" size="255" required="false"/>
......
This diff is collapsed.
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"autoload-dev": {
"files": [ "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
},
"require": {
"php": ">=5.3.9",
"automattic/woocommerce": "^3.0",
"doctrine/doctrine-bundle": "~1.4",
"doctrine/orm": "^2.4.8",
"dompdf/dompdf": "^0.8.3",
"incenteev/composer-parameter-handler": "~2.0",
"jms/serializer-bundle": "^1.1",
"longman/telegram-bot": "^0.63.1",
"propel/propel-bundle": "^1.5",
"sensio/framework-extra-bundle": "^3.0.2",
"symfony/monolog-bundle": "^3.0.2",
"symfony/swiftmailer-bundle": "~2.3,>=2.3.10",
"symfony/symfony": "2.8.5",
"sensio/distribution-bundle": "~5.0",
"treinetic/imageartist": "^1.0",
"twig/twig": "^1.5"
},
"require-dev": {
"sensio/generator-bundle": "~3.0",
"symfony/phpunit-bridge": "~2.7"
},
"scripts": {
"symfony-scripts": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-install-cmd": [
"@symfony-scripts"
],
"post-update-cmd": [
"@symfony-scripts"
]
},
"config": {
"bin-dir": "bin",
"platform": {
"php": "5.6"
},
"sort-packages": true
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.8-dev"
}
}
}
This diff is collapsed.
{
"name": "symfony/framework-standard-edition",
"license": "MIT",
"type": "project",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-4": {
"": "src/"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"autoload-dev": {
"files": [ "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
},
"require": {
"php": ">=5.3.9",
"automattic/woocommerce": "^3.0",
"doctrine/doctrine-bundle": "~1.4",
"doctrine/orm": "^2.4.8",
"dompdf/dompdf": "^0.8.3",
"incenteev/composer-parameter-handler": "~2.0",
"jms/serializer-bundle": "^1.1",
"longman/telegram-bot": "^0.63.1",
"propel/propel-bundle": "^1.5",
"sensio/framework-extra-bundle": "^3.0.2",
"symfony/monolog-bundle": "^3.0.2",
"symfony/swiftmailer-bundle": "~2.3,>=2.3.10",
"symfony/symfony": "2.8.5",
"sensio/distribution-bundle": "~5.0",
"treinetic/imageartist": "^1.0",
"twig/twig": "^1.5"
},
"require-dev": {
"sensio/generator-bundle": "~3.0",
"symfony/phpunit-bridge": "~2.7"
},
"scripts": {
"symfony-scripts": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-install-cmd": [
"@symfony-scripts"
],
"post-update-cmd": [
"@symfony-scripts"
]
},
"config": {
"bin-dir": "bin",
"platform": {
"php": "5.6"
},
"sort-packages": true
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": {
"dev-master": "2.8-dev"
}
}
}
......@@ -27,6 +27,17 @@ class Utiles {
$log->pushHandler($handler);
return $log;
}
public static function isMobile($useragent) {
if (!$useragent) {
return -1;
}
return (
preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i', $useragent) ||
preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i', substr($useragent, 0, 4))
);
}
public static function isMsisdn2($msisdn) {
// if(preg_match("/^[0-9]+$/", $msisdn) && strlen($msisdn) == 11)
......
......@@ -10,4 +10,7 @@ class Disposicion extends BaseDisposicion
const ELIMINADO_FALSE = 0;
const ACTIVO_TRUE = 1;
const ACTIVO_FALSE = 0;
const DISPOSICION_MOVIL = 1;
const DISPOSICION_DESKTOP = 2;
const DISPOSICION_AMBOS = 3;
}
<?php
namespace AppBundle\Model;
use AppBundle\Model\om\BaseTemplateCssRelacion;
class TemplateCssRelacion extends BaseTemplateCssRelacion
{
const SECCION_HEAD = 1;
const SECCION_BODY = 2;
const SECCION_FOOTER = 3;
const ENTORNO_MOVIL = 1;
const ENTORNO_DESKTOP = 2;
const ENTORNO_AMBOS = 3;
const TIPO_CONTENIDO_TEXTO = 1;
const TIPO_CONTENIDO_IMAGEN = 2;
const TIPO_CONTENIDO_VIDEO = 3;
}
<?php
namespace AppBundle\Model;
use AppBundle\Model\om\BaseTemplateCssRelacionPeer;
class TemplateCssRelacionPeer extends BaseTemplateCssRelacionPeer
{
}
<?php
namespace AppBundle\Model;
use AppBundle\Model\om\BaseTemplateCssRelacionQuery;
class TemplateCssRelacionQuery extends BaseTemplateCssRelacionQuery
{
}
......@@ -50,6 +50,7 @@ class CampaniaContenidoTableMap extends TableMap
$this->addForeignKey('fil_id', 'FilId', 'INTEGER', 'fila', 'fil_id', false, null, null);
$this->addColumn('cco_entorno', 'CcoEntorno', 'INTEGER', false, null, null);
$this->addColumn('cco_contenido', 'CcoContenido', 'LONGVARCHAR', false, null, null);
$this->addColumn('cco_fila', 'CcoFila', 'INTEGER', false, null, null);
$this->addColumn('cco_columna', 'CcoColumna', 'INTEGER', false, null, null);
$this->addColumn('cco_orden', 'CcoOrden', 'INTEGER', false, null, null);
$this->addColumn('cco_tipo', 'CcoTipo', 'INTEGER', false, null, null);
......
......@@ -57,6 +57,7 @@ class DisposicionColumnasTableMap extends TableMap
{
$this->addRelation('CampaniaContenido', 'AppBundle\\Model\\CampaniaContenido', RelationMap::ONE_TO_MANY, array('dco_id' => 'dco_id', ), null, null, 'CampaniaContenidos');
$this->addRelation('Fila', 'AppBundle\\Model\\Fila', RelationMap::ONE_TO_MANY, array('dco_id' => 'dco_id', ), null, null, 'Filas');
$this->addRelation('TemplateCssRelacion', 'AppBundle\\Model\\TemplateCssRelacion', RelationMap::ONE_TO_MANY, array('dco_id' => 'dco_id', ), null, null, 'TemplateCssRelacions');
} // buildRelations()
} // DisposicionColumnasTableMap
<?php
namespace AppBundle\Model\map;
use \RelationMap;
use \TableMap;
/**
* This class defines the structure of the 'template_css_relacion' table.
*
*
*
* This map class is used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package propel.generator.src.AppBundle.Model.map
*/
class TemplateCssRelacionTableMap extends TableMap
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'src.AppBundle.Model.map.TemplateCssRelacionTableMap';
/**
* Initialize the table attributes, columns and validators
* Relations are not initialized by this method since they are lazy loaded
*
* @return void
* @throws PropelException
*/
public function initialize()
{
// attributes
$this->setName('template_css_relacion');
$this->setPhpName('TemplateCssRelacion');
$this->setClassname('AppBundle\\Model\\TemplateCssRelacion');
$this->setPackage('src.AppBundle.Model');
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('tcr_id', 'TcrId', 'INTEGER', true, null, null);
$this->addForeignKey('tem_id', 'TemId', 'INTEGER', 'template', 'tem_id', false, null, null);
$this->addForeignKey('dco_id', 'DcoId', 'INTEGER', 'disposicion_columnas', 'dco_id', false, null, null);
$this->addColumn('tcr_tipo', 'TcrTipo', 'INTEGER', false, null, null);
$this->addColumn('tcr_entorno', 'TcrEntorno', 'INTEGER', false, null, null);
$this->addColumn('tcr_clase_css', 'TcrClaseCss', 'VARCHAR', false, 1000, null);
// validators
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
$this->addRelation('DisposicionColumnas', 'AppBundle\\Model\\DisposicionColumnas', RelationMap::MANY_TO_ONE, array('dco_id' => 'dco_id', ), null, null);
$this->addRelation('Template', 'AppBundle\\Model\\Template', RelationMap::MANY_TO_ONE, array('tem_id' => 'tem_id', ), null, null);
} // buildRelations()
} // TemplateCssRelacionTableMap
......@@ -60,6 +60,7 @@ class TemplateTableMap extends TableMap
public function buildRelations()
{
$this->addRelation('Campania', 'AppBundle\\Model\\Campania', RelationMap::ONE_TO_MANY, array('tem_id' => 'tem_id', ), null, null, 'Campanias');
$this->addRelation('TemplateCssRelacion', 'AppBundle\\Model\\TemplateCssRelacion', RelationMap::ONE_TO_MANY, array('tem_id' => 'tem_id', ), null, null, 'TemplateCssRelacions');
} // buildRelations()
/**
......
......@@ -34,13 +34,13 @@ abstract class BaseCampaniaContenidoPeer
const TM_CLASS = 'AppBundle\\Model\\map\\CampaniaContenidoTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 15;
const NUM_COLUMNS = 16;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */
const NUM_HYDRATE_COLUMNS = 15;
const NUM_HYDRATE_COLUMNS = 16;
/** the column name for the cco_id field */
const CCO_ID = 'campania_contenido.cco_id';
......@@ -66,6 +66,9 @@ abstract class BaseCampaniaContenidoPeer
/** the column name for the cco_contenido field */
const CCO_CONTENIDO = 'campania_contenido.cco_contenido';
/** the column name for the cco_fila field */
const CCO_FILA = 'campania_contenido.cco_fila';
/** the column name for the cco_columna field */
const CCO_COLUMNA = 'campania_contenido.cco_columna';
......@@ -106,12 +109,12 @@ abstract class BaseCampaniaContenidoPeer
* e.g. CampaniaContenidoPeer::$fieldNames[CampaniaContenidoPeer::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('CcoId', 'CamId', 'DisId', 'DcoId', 'SecId', 'FilId', 'CcoEntorno', 'CcoContenido', 'CcoColumna', 'CcoOrden', 'CcoTipo', 'CcoEstado', 'CcoEliminado', 'CreatedAt', 'UpdatedAt', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('ccoId', 'camId', 'disId', 'dcoId', 'secId', 'filId', 'ccoEntorno', 'ccoContenido', 'ccoColumna', 'ccoOrden', 'ccoTipo', 'ccoEstado', 'ccoEliminado', 'createdAt', 'updatedAt', ),
BasePeer::TYPE_COLNAME => array (CampaniaContenidoPeer::CCO_ID, CampaniaContenidoPeer::CAM_ID, CampaniaContenidoPeer::DIS_ID, CampaniaContenidoPeer::DCO_ID, CampaniaContenidoPeer::SEC_ID, CampaniaContenidoPeer::FIL_ID, CampaniaContenidoPeer::CCO_ENTORNO, CampaniaContenidoPeer::CCO_CONTENIDO, CampaniaContenidoPeer::CCO_COLUMNA, CampaniaContenidoPeer::CCO_ORDEN, CampaniaContenidoPeer::CCO_TIPO, CampaniaContenidoPeer::CCO_ESTADO, CampaniaContenidoPeer::CCO_ELIMINADO, CampaniaContenidoPeer::CREATED_AT, CampaniaContenidoPeer::UPDATED_AT, ),
BasePeer::TYPE_RAW_COLNAME => array ('CCO_ID', 'CAM_ID', 'DIS_ID', 'DCO_ID', 'SEC_ID', 'FIL_ID', 'CCO_ENTORNO', 'CCO_CONTENIDO', 'CCO_COLUMNA', 'CCO_ORDEN', 'CCO_TIPO', 'CCO_ESTADO', 'CCO_ELIMINADO', 'CREATED_AT', 'UPDATED_AT', ),
BasePeer::TYPE_FIELDNAME => array ('cco_id', 'cam_id', 'dis_id', 'dco_id', 'sec_id', 'fil_id', 'cco_entorno', 'cco_contenido', 'cco_columna', 'cco_orden', 'cco_tipo', 'cco_estado', 'cco_eliminado', 'created_at', 'updated_at', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
BasePeer::TYPE_PHPNAME => array ('CcoId', 'CamId', 'DisId', 'DcoId', 'SecId', 'FilId', 'CcoEntorno', 'CcoContenido', 'CcoFila', 'CcoColumna', 'CcoOrden', 'CcoTipo', 'CcoEstado', 'CcoEliminado', 'CreatedAt', 'UpdatedAt', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('ccoId', 'camId', 'disId', 'dcoId', 'secId', 'filId', 'ccoEntorno', 'ccoContenido', 'ccoFila', 'ccoColumna', 'ccoOrden', 'ccoTipo', 'ccoEstado', 'ccoEliminado', 'createdAt', 'updatedAt', ),
BasePeer::TYPE_COLNAME => array (CampaniaContenidoPeer::CCO_ID, CampaniaContenidoPeer::CAM_ID, CampaniaContenidoPeer::DIS_ID, CampaniaContenidoPeer::DCO_ID, CampaniaContenidoPeer::SEC_ID, CampaniaContenidoPeer::FIL_ID, CampaniaContenidoPeer::CCO_ENTORNO, CampaniaContenidoPeer::CCO_CONTENIDO, CampaniaContenidoPeer::CCO_FILA, CampaniaContenidoPeer::CCO_COLUMNA, CampaniaContenidoPeer::CCO_ORDEN, CampaniaContenidoPeer::CCO_TIPO, CampaniaContenidoPeer::CCO_ESTADO, CampaniaContenidoPeer::CCO_ELIMINADO, CampaniaContenidoPeer::CREATED_AT, CampaniaContenidoPeer::UPDATED_AT, ),
BasePeer::TYPE_RAW_COLNAME => array ('CCO_ID', 'CAM_ID', 'DIS_ID', 'DCO_ID', 'SEC_ID', 'FIL_ID', 'CCO_ENTORNO', 'CCO_CONTENIDO', 'CCO_FILA', 'CCO_COLUMNA', 'CCO_ORDEN', 'CCO_TIPO', 'CCO_ESTADO', 'CCO_ELIMINADO', 'CREATED_AT', 'UPDATED_AT', ),
BasePeer::TYPE_FIELDNAME => array ('cco_id', 'cam_id', 'dis_id', 'dco_id', 'sec_id', 'fil_id', 'cco_entorno', 'cco_contenido', 'cco_fila', 'cco_columna', 'cco_orden', 'cco_tipo', 'cco_estado', 'cco_eliminado', 'created_at', 'updated_at', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
);
/**
......@@ -121,12 +124,12 @@ abstract class BaseCampaniaContenidoPeer
* e.g. CampaniaContenidoPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('CcoId' => 0, 'CamId' => 1, 'DisId' => 2, 'DcoId' => 3, 'SecId' => 4, 'FilId' => 5, 'CcoEntorno' => 6, 'CcoContenido' => 7, 'CcoColumna' => 8, 'CcoOrden' => 9, 'CcoTipo' => 10, 'CcoEstado' => 11, 'CcoEliminado' => 12, 'CreatedAt' => 13, 'UpdatedAt' => 14, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('ccoId' => 0, 'camId' => 1, 'disId' => 2, 'dcoId' => 3, 'secId' => 4, 'filId' => 5, 'ccoEntorno' => 6, 'ccoContenido' => 7, 'ccoColumna' => 8, 'ccoOrden' => 9, 'ccoTipo' => 10, 'ccoEstado' => 11, 'ccoEliminado' => 12, 'createdAt' => 13, 'updatedAt' => 14, ),
BasePeer::TYPE_COLNAME => array (CampaniaContenidoPeer::CCO_ID => 0, CampaniaContenidoPeer::CAM_ID => 1, CampaniaContenidoPeer::DIS_ID => 2, CampaniaContenidoPeer::DCO_ID => 3, CampaniaContenidoPeer::SEC_ID => 4, CampaniaContenidoPeer::FIL_ID => 5, CampaniaContenidoPeer::CCO_ENTORNO => 6, CampaniaContenidoPeer::CCO_CONTENIDO => 7, CampaniaContenidoPeer::CCO_COLUMNA => 8, CampaniaContenidoPeer::CCO_ORDEN => 9, CampaniaContenidoPeer::CCO_TIPO => 10, CampaniaContenidoPeer::CCO_ESTADO => 11, CampaniaContenidoPeer::CCO_ELIMINADO => 12, CampaniaContenidoPeer::CREATED_AT => 13, CampaniaContenidoPeer::UPDATED_AT => 14, ),
BasePeer::TYPE_RAW_COLNAME => array ('CCO_ID' => 0, 'CAM_ID' => 1, 'DIS_ID' => 2, 'DCO_ID' => 3, 'SEC_ID' => 4, 'FIL_ID' => 5, 'CCO_ENTORNO' => 6, 'CCO_CONTENIDO' => 7, 'CCO_COLUMNA' => 8, 'CCO_ORDEN' => 9, 'CCO_TIPO' => 10, 'CCO_ESTADO' => 11, 'CCO_ELIMINADO' => 12, 'CREATED_AT' => 13, 'UPDATED_AT' => 14, ),
BasePeer::TYPE_FIELDNAME => array ('cco_id' => 0, 'cam_id' => 1, 'dis_id' => 2, 'dco_id' => 3, 'sec_id' => 4, 'fil_id' => 5, 'cco_entorno' => 6, 'cco_contenido' => 7, 'cco_columna' => 8, 'cco_orden' => 9, 'cco_tipo' => 10, 'cco_estado' => 11, 'cco_eliminado' => 12, 'created_at' => 13, 'updated_at' => 14, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, )
BasePeer::TYPE_PHPNAME => array ('CcoId' => 0, 'CamId' => 1, 'DisId' => 2, 'DcoId' => 3, 'SecId' => 4, 'FilId' => 5, 'CcoEntorno' => 6, 'CcoContenido' => 7, 'CcoFila' => 8, 'CcoColumna' => 9, 'CcoOrden' => 10, 'CcoTipo' => 11, 'CcoEstado' => 12, 'CcoEliminado' => 13, 'CreatedAt' => 14, 'UpdatedAt' => 15, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('ccoId' => 0, 'camId' => 1, 'disId' => 2, 'dcoId' => 3, 'secId' => 4, 'filId' => 5, 'ccoEntorno' => 6, 'ccoContenido' => 7, 'ccoFila' => 8, 'ccoColumna' => 9, 'ccoOrden' => 10, 'ccoTipo' => 11, 'ccoEstado' => 12, 'ccoEliminado' => 13, 'createdAt' => 14, 'updatedAt' => 15, ),
BasePeer::TYPE_COLNAME => array (CampaniaContenidoPeer::CCO_ID => 0, CampaniaContenidoPeer::CAM_ID => 1, CampaniaContenidoPeer::DIS_ID => 2, CampaniaContenidoPeer::DCO_ID => 3, CampaniaContenidoPeer::SEC_ID => 4, CampaniaContenidoPeer::FIL_ID => 5, CampaniaContenidoPeer::CCO_ENTORNO => 6, CampaniaContenidoPeer::CCO_CONTENIDO => 7, CampaniaContenidoPeer::CCO_FILA => 8, CampaniaContenidoPeer::CCO_COLUMNA => 9, CampaniaContenidoPeer::CCO_ORDEN => 10, CampaniaContenidoPeer::CCO_TIPO => 11, CampaniaContenidoPeer::CCO_ESTADO => 12, CampaniaContenidoPeer::CCO_ELIMINADO => 13, CampaniaContenidoPeer::CREATED_AT => 14, CampaniaContenidoPeer::UPDATED_AT => 15, ),
BasePeer::TYPE_RAW_COLNAME => array ('CCO_ID' => 0, 'CAM_ID' => 1, 'DIS_ID' => 2, 'DCO_ID' => 3, 'SEC_ID' => 4, 'FIL_ID' => 5, 'CCO_ENTORNO' => 6, 'CCO_CONTENIDO' => 7, 'CCO_FILA' => 8, 'CCO_COLUMNA' => 9, 'CCO_ORDEN' => 10, 'CCO_TIPO' => 11, 'CCO_ESTADO' => 12, 'CCO_ELIMINADO' => 13, 'CREATED_AT' => 14, 'UPDATED_AT' => 15, ),
BasePeer::TYPE_FIELDNAME => array ('cco_id' => 0, 'cam_id' => 1, 'dis_id' => 2, 'dco_id' => 3, 'sec_id' => 4, 'fil_id' => 5, 'cco_entorno' => 6, 'cco_contenido' => 7, 'cco_fila' => 8, 'cco_columna' => 9, 'cco_orden' => 10, 'cco_tipo' => 11, 'cco_estado' => 12, 'cco_eliminado' => 13, 'created_at' => 14, 'updated_at' => 15, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, )
);
/**
......@@ -208,6 +211,7 @@ abstract class BaseCampaniaContenidoPeer
$criteria->addSelectColumn(CampaniaContenidoPeer::FIL_ID);
$criteria->addSelectColumn(CampaniaContenidoPeer::CCO_ENTORNO);
$criteria->addSelectColumn(CampaniaContenidoPeer::CCO_CONTENIDO);
$criteria->addSelectColumn(CampaniaContenidoPeer::CCO_FILA);
$criteria->addSelectColumn(CampaniaContenidoPeer::CCO_COLUMNA);
$criteria->addSelectColumn(CampaniaContenidoPeer::CCO_ORDEN);
$criteria->addSelectColumn(CampaniaContenidoPeer::CCO_TIPO);
......@@ -224,6 +228,7 @@ abstract class BaseCampaniaContenidoPeer
$criteria->addSelectColumn($alias . '.fil_id');
$criteria->addSelectColumn($alias . '.cco_entorno');
$criteria->addSelectColumn($alias . '.cco_contenido');
$criteria->addSelectColumn($alias . '.cco_fila');
$criteria->addSelectColumn($alias . '.cco_columna');
$criteria->addSelectColumn($alias . '.cco_orden');
$criteria->addSelectColumn($alias . '.cco_tipo');
......
......@@ -30,6 +30,7 @@ use AppBundle\Model\Seccion;
* @method CampaniaContenidoQuery orderByFilId($order = Criteria::ASC) Order by the fil_id column
* @method CampaniaContenidoQuery orderByCcoEntorno($order = Criteria::ASC) Order by the cco_entorno column
* @method CampaniaContenidoQuery orderByCcoContenido($order = Criteria::ASC) Order by the cco_contenido column
* @method CampaniaContenidoQuery orderByCcoFila($order = Criteria::ASC) Order by the cco_fila column
* @method CampaniaContenidoQuery orderByCcoColumna($order = Criteria::ASC) Order by the cco_columna column
* @method CampaniaContenidoQuery orderByCcoOrden($order = Criteria::ASC) Order by the cco_orden column
* @method CampaniaContenidoQuery orderByCcoTipo($order = Criteria::ASC) Order by the cco_tipo column
......@@ -46,6 +47,7 @@ use AppBundle\Model\Seccion;
* @method CampaniaContenidoQuery groupByFilId() Group by the fil_id column
* @method CampaniaContenidoQuery groupByCcoEntorno() Group by the cco_entorno column
* @method CampaniaContenidoQuery groupByCcoContenido() Group by the cco_contenido column
* @method CampaniaContenidoQuery groupByCcoFila() Group by the cco_fila column
* @method CampaniaContenidoQuery groupByCcoColumna() Group by the cco_columna column
* @method CampaniaContenidoQuery groupByCcoOrden() Group by the cco_orden column
* @method CampaniaContenidoQuery groupByCcoTipo() Group by the cco_tipo column
......@@ -88,6 +90,7 @@ use AppBundle\Model\Seccion;
* @method CampaniaContenido findOneByFilId(int $fil_id) Return the first CampaniaContenido filtered by the fil_id column
* @method CampaniaContenido findOneByCcoEntorno(int $cco_entorno) Return the first CampaniaContenido filtered by the cco_entorno column
* @method CampaniaContenido findOneByCcoContenido(string $cco_contenido) Return the first CampaniaContenido filtered by the cco_contenido column
* @method CampaniaContenido findOneByCcoFila(int $cco_fila) Return the first CampaniaContenido filtered by the cco_fila column
* @method CampaniaContenido findOneByCcoColumna(int $cco_columna) Return the first CampaniaContenido filtered by the cco_columna column
* @method CampaniaContenido findOneByCcoOrden(int $cco_orden) Return the first CampaniaContenido filtered by the cco_orden column
* @method CampaniaContenido findOneByCcoTipo(int $cco_tipo) Return the first CampaniaContenido filtered by the cco_tipo column
......@@ -104,6 +107,7 @@ use AppBundle\Model\Seccion;
* @method array findByFilId(int $fil_id) Return CampaniaContenido objects filtered by the fil_id column
* @method array findByCcoEntorno(int $cco_entorno) Return CampaniaContenido objects filtered by the cco_entorno column
* @method array findByCcoContenido(string $cco_contenido) Return CampaniaContenido objects filtered by the cco_contenido column
* @method array findByCcoFila(int $cco_fila) Return CampaniaContenido objects filtered by the cco_fila column
* @method array findByCcoColumna(int $cco_columna) Return CampaniaContenido objects filtered by the cco_columna column
* @method array findByCcoOrden(int $cco_orden) Return CampaniaContenido objects filtered by the cco_orden column
* @method array findByCcoTipo(int $cco_tipo) Return CampaniaContenido objects filtered by the cco_tipo column
......@@ -216,7 +220,7 @@ abstract class BaseCampaniaContenidoQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT `cco_id`, `cam_id`, `dis_id`, `dco_id`, `sec_id`, `fil_id`, `cco_entorno`, `cco_contenido`, `cco_columna`, `cco_orden`, `cco_tipo`, `cco_estado`, `cco_eliminado`, `created_at`, `updated_at` FROM `campania_contenido` WHERE `cco_id` = :p0';
$sql = 'SELECT `cco_id`, `cam_id`, `dis_id`, `dco_id`, `sec_id`, `fil_id`, `cco_entorno`, `cco_contenido`, `cco_fila`, `cco_columna`, `cco_orden`, `cco_tipo`, `cco_estado`, `cco_eliminado`, `created_at`, `updated_at` FROM `campania_contenido` WHERE `cco_id` = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
......@@ -638,6 +642,48 @@ abstract class BaseCampaniaContenidoQuery extends ModelCriteria
return $this->addUsingAlias(CampaniaContenidoPeer::CCO_CONTENIDO, $ccoContenido, $comparison);
}
/**
* Filter the query on the cco_fila column
*
* Example usage:
* <code>
* $query->filterByCcoFila(1234); // WHERE cco_fila = 1234
* $query->filterByCcoFila(array(12, 34)); // WHERE cco_fila IN (12, 34)
* $query->filterByCcoFila(array('min' => 12)); // WHERE cco_fila >= 12
* $query->filterByCcoFila(array('max' => 12)); // WHERE cco_fila <= 12
* </code>
*
* @param mixed $ccoFila The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CampaniaContenidoQuery The current query, for fluid interface
*/
public function filterByCcoFila($ccoFila = null, $comparison = null)
{
if (is_array($ccoFila)) {
$useMinMax = false;
if (isset($ccoFila['min'])) {
$this->addUsingAlias(CampaniaContenidoPeer::CCO_FILA, $ccoFila['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($ccoFila['max'])) {
$this->addUsingAlias(CampaniaContenidoPeer::CCO_FILA, $ccoFila['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CampaniaContenidoPeer::CCO_FILA, $ccoFila, $comparison);
}
/**
* Filter the query on the cco_columna column
*
......
......@@ -17,6 +17,7 @@ use AppBundle\Model\DisposicionColumnas;
use AppBundle\Model\DisposicionColumnasPeer;
use AppBundle\Model\DisposicionColumnasQuery;
use AppBundle\Model\Fila;
use AppBundle\Model\TemplateCssRelacion;
/**
* @method DisposicionColumnasQuery orderByDcoId($order = Criteria::ASC) Order by the dco_id column
......@@ -43,6 +44,10 @@ use AppBundle\Model\Fila;
* @method DisposicionColumnasQuery rightJoinFila($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Fila relation
* @method DisposicionColumnasQuery innerJoinFila($relationAlias = null) Adds a INNER JOIN clause to the query using the Fila relation
*
* @method DisposicionColumnasQuery leftJoinTemplateCssRelacion($relationAlias = null) Adds a LEFT JOIN clause to the query using the TemplateCssRelacion relation
* @method DisposicionColumnasQuery rightJoinTemplateCssRelacion($relationAlias = null) Adds a RIGHT JOIN clause to the query using the TemplateCssRelacion relation
* @method DisposicionColumnasQuery innerJoinTemplateCssRelacion($relationAlias = null) Adds a INNER JOIN clause to the query using the TemplateCssRelacion relation
*
* @method DisposicionColumnas findOne(PropelPDO $con = null) Return the first DisposicionColumnas matching the query
* @method DisposicionColumnas findOneOrCreate(PropelPDO $con = null) Return the first DisposicionColumnas matching the query, or a new DisposicionColumnas object populated from the query conditions when no match is found
*
......@@ -595,6 +600,80 @@ abstract class BaseDisposicionColumnasQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'Fila', '\AppBundle\Model\FilaQuery');
}
/**
* Filter the query by a related TemplateCssRelacion object
*
* @param TemplateCssRelacion|PropelObjectCollection $templateCssRelacion the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return DisposicionColumnasQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByTemplateCssRelacion($templateCssRelacion, $comparison = null)
{
if ($templateCssRelacion instanceof TemplateCssRelacion) {
return $this
->addUsingAlias(DisposicionColumnasPeer::DCO_ID, $templateCssRelacion->getDcoId(), $comparison);
} elseif ($templateCssRelacion instanceof PropelObjectCollection) {
return $this
->useTemplateCssRelacionQuery()
->filterByPrimaryKeys($templateCssRelacion->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByTemplateCssRelacion() only accepts arguments of type TemplateCssRelacion or PropelCollection');
}
}
/**
* Adds a JOIN clause to the query using the TemplateCssRelacion relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return DisposicionColumnasQuery The current query, for fluid interface
*/
public function joinTemplateCssRelacion($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('TemplateCssRelacion');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'TemplateCssRelacion');
}
return $this;
}
/**
* Use the TemplateCssRelacion relation TemplateCssRelacion object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \AppBundle\Model\TemplateCssRelacionQuery A secondary query class using the current class as primary query
*/
public function useTemplateCssRelacionQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinTemplateCssRelacion($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'TemplateCssRelacion', '\AppBundle\Model\TemplateCssRelacionQuery');
}
/**
* Exclude object from result
*
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -14,6 +14,7 @@ use \PropelObjectCollection;
use \PropelPDO;
use AppBundle\Model\Campania;
use AppBundle\Model\Template;
use AppBundle\Model\TemplateCssRelacion;
use AppBundle\Model\TemplatePeer;
use AppBundle\Model\TemplateQuery;
......@@ -46,6 +47,10 @@ use AppBundle\Model\TemplateQuery;
* @method TemplateQuery rightJoinCampania($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Campania relation
* @method TemplateQuery innerJoinCampania($relationAlias = null) Adds a INNER JOIN clause to the query using the Campania relation
*
* @method TemplateQuery leftJoinTemplateCssRelacion($relationAlias = null) Adds a LEFT JOIN clause to the query using the TemplateCssRelacion relation
* @method TemplateQuery rightJoinTemplateCssRelacion($relationAlias = null) Adds a RIGHT JOIN clause to the query using the TemplateCssRelacion relation
* @method TemplateQuery innerJoinTemplateCssRelacion($relationAlias = null) Adds a INNER JOIN clause to the query using the TemplateCssRelacion relation
*
* @method Template findOne(PropelPDO $con = null) Return the first Template matching the query
* @method Template findOneOrCreate(PropelPDO $con = null) Return the first Template matching the query, or a new Template object populated from the query conditions when no match is found
*
......@@ -663,6 +668,80 @@ abstract class BaseTemplateQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'Campania', '\AppBundle\Model\CampaniaQuery');
}
/**
* Filter the query by a related TemplateCssRelacion object
*
* @param TemplateCssRelacion|PropelObjectCollection $templateCssRelacion the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return TemplateQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterByTemplateCssRelacion($templateCssRelacion, $comparison = null)
{
if ($templateCssRelacion instanceof TemplateCssRelacion) {
return $this
->addUsingAlias(TemplatePeer::TEM_ID, $templateCssRelacion->getTemId(), $comparison);
} elseif ($templateCssRelacion instanceof PropelObjectCollection) {
return $this
->useTemplateCssRelacionQuery()
->filterByPrimaryKeys($templateCssRelacion->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterByTemplateCssRelacion() only accepts arguments of type TemplateCssRelacion or PropelCollection');
}
}
/**
* Adds a JOIN clause to the query using the TemplateCssRelacion relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return TemplateQuery The current query, for fluid interface
*/
public function joinTemplateCssRelacion($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('TemplateCssRelacion');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'TemplateCssRelacion');
}
return $this;
}
/**
* Use the TemplateCssRelacion relation TemplateCssRelacion object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \AppBundle\Model\TemplateCssRelacionQuery A secondary query class using the current class as primary query
*/
public function useTemplateCssRelacionQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinTemplateCssRelacion($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'TemplateCssRelacion', '\AppBundle\Model\TemplateCssRelacionQuery');
}
/**
* Exclude object from result
*
......
......@@ -82,6 +82,7 @@
<column name="fil_id" phpName="FilId" type="INTEGER" required="false"/>
<column name="cco_entorno" phpName="CcoEntorno" type="INTEGER" required="false"/>
<column name="cco_contenido" phpName="CcoContenido" type="LONGVARCHAR" required="false"/>
<column name="cco_fila" phpName="CcoFila" type="INTEGER" required="false"/>
<column name="cco_columna" phpName="CcoColumna" type="INTEGER" required="false"/>
<column name="cco_orden" phpName="CcoOrden" type="INTEGER" required="false"/>
<column name="cco_tipo" phpName="CcoTipo" type="INTEGER" required="false"/>
......@@ -216,6 +217,29 @@
<parameter name="Engine" value="InnoDB"/>
</vendor>
</table>
<table name="template_css_relacion" phpName="TemplateCssRelacion" idMethod="native">
<column name="tcr_id" phpName="TcrId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="tem_id" phpName="TemId" type="INTEGER" required="false"/>
<column name="dco_id" phpName="DcoId" type="INTEGER" required="false"/>
<column name="tcr_tipo" phpName="TcrTipo" type="INTEGER" required="false"/>
<column name="tcr_entorno" phpName="TcrEntorno" type="INTEGER" required="false"/>
<column name="tcr_clase_css" phpName="TcrClaseCss" type="VARCHAR" size="1000" required="false"/>
<foreign-key foreignTable="disposicion_columnas" name="fk_dco_id_relacion" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference local="dco_id" foreign="dco_id"/>
</foreign-key>
<foreign-key foreignTable="template" name="fk_tem_id_relacion" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference local="tem_id" foreign="tem_id"/>
</foreign-key>
<index name="fk_tem_id_relacion_idx">
<index-column name="tem_id"/>
</index>
<index name="fk_dco_id_relacion_idx">
<index-column name="dco_id"/>
</index>
<vendor type="mysql">
<parameter name="Engine" value="InnoDB"/>
</vendor>
</table>
<table name="tipo" phpName="Tipo" idMethod="native">
<column name="tip_id" phpName="TipId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="tip_nombre" phpName="TipNombre" type="VARCHAR" size="255" required="false"/>
......
......@@ -116,6 +116,46 @@ class CampaniaController extends Controller {
)
);
}
public function generarNuevaFilaAction(Request $request) {
$log = Utiles::setLog('CampaniaBundle\Controller\CampaniaController:nuevaCampaniaAction', 'mcafee/campania/index');
$secId = $request->get("secId", null);
$campaniaId = $request->get("camId", null);
$jResponse = new JsonResponse();
//Obtener la cantidad de filas actuales para la seccion donde se va a agregar.
$contadorFilasActuales = FilaQuery::create()->filterBySecId($secId)->filterByCamId($campaniaId)->filterByFilEliminado(Fila::ELIMINADO_FALSE)->filterByFilEstado(Fila::ACTIVO_TRUE)->count();
$seccion = SeccionQuery::create()->findPk($secId);
if (($secId == Seccion::SECCION_HEAD && $contadorFilasActuales >= self::MAX_HEAD_ROWS) || ($secId == Seccion::SECCION_FOOTER && $contadorFilasActuales >= self::MAX_FOOTER_ROWS )) {
$log->debug("se alcanzo el numero máximo de filas para la seccion $secId...");
$jResponse->setStatusCode(JsonResponse::HTTP_BAD_REQUEST, '- MAX ROWS REACHED');
$jResponse->setData(array("msg" => "No se pueden crear mas filas para la seccion actual"));
return $jResponse;
}
$log->debug("creando fila para seccion $secId...");
$lastColumnValue = FilaQuery::getNewColumnValue($secId, $campaniaId);
$log->debug("ultimo valor columna $lastColumnValue...");
$newColumnValue = $lastColumnValue + 1;
$log->debug("valor nueva columna $newColumnValue...");
$row = new Fila();
$row->setCamId($campaniaId);
$row->setSecId($secId);
$row->setFilValor($newColumnValue);
$row->setFilNumCol(self::DEFAULT_COLUMN_NUMBER);
$row->setDcoId(DisposicionColumnas::DISPOSICION_1);
$row->setFilEstado(Fila::ACTIVO_TRUE);
$row->setFilEliminado(Fila::ELIMINADO_FALSE);
$row->save();
$log->debug("fila numero $newColumnValue creada correctamente para la seccion $secId de la campania $campaniaId");
$jResponse->setStatusCode(JsonResponse::HTTP_OK, '- NEW ROW');
$jResponse->setData(array("msg" => "Se ha creado una nueva fila para la seccion '" . $seccion->getSecNombre() . "'", "filId" => $row->getFilId()));
return $jResponse;
}
/**
*
......@@ -244,6 +284,7 @@ class CampaniaController extends Controller {
$contenidoCampania->setDcoId($disposicionId);
$contenidoCampania->setSecId($seccionId);
$contenidoCampania->setFilId($filaId);
$contenidoCampania->setCcoFila($fila->getFilValor());
$contenidoCampania->setCcoContenido($contenido);
$contenidoCampania->setCcoColumna($columna);
$contenidoCampania->setCcoOrden(1);
......@@ -333,6 +374,7 @@ class CampaniaController extends Controller {
$contenidoCampania->setDcoId($disposicionId);
$contenidoCampania->setSecId($seccionId);
$contenidoCampania->setFilId($filaId);
$contenidoCampania->setCcoFila($fila->getFilValor());
$contenidoCampania->setCcoContenido($contenido);
$contenidoCampania->setCcoColumna($columna);
$contenidoCampania->setCcoOrden(1);
......@@ -441,6 +483,30 @@ class CampaniaController extends Controller {
return $this->render("backend_content/pages/campanias/listadoCampanias.html.twig", array("campanias" => $campanias));
}
public function cargarHtmlFrontAction(){
$data = array('id'=>24);
$data_json = json_encode($data);
$htmlContent = array();
$username = "userApi";
$password = "34lq4od8usda";
try {
$url = "127.0.0.1:8000/api/mcafee/campania/obtener/contenido.json";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
$output = curl_exec($ch);
curl_close($ch);
$htmlContent = json_decode($output, true);
} catch (\Exception $e) {
}
return $this->render('front/campania/prueba.html.twig', array("htmlContent" => $htmlContent));
}
public function loadDataContenidoAction(Request $request){
$log = Utiles::setLog('CampaniaBundle\Controller\CampaniaController:loadDataContenidoAction', 'mcafee/campania/index');
$user = $this->get('security.token_storage')->getToken()->getUser();
......
<?php
namespace WsBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use JMS\Serializer\Exception\RuntimeException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpFoundation\Request;
class ApiController extends Controller
{
protected function deserialize($class, Request $request, $format = 'json')
{
$serializer = $this->get('serializer');
$validator = $this->get('validator');
try {
$entity = $serializer->deserialize($request->getContent(), $class, $format);
} catch (RuntimeException $e) {
throw new HttpException(400, $e->getMessage());
}
if (count($errors = $validator->validate($entity))) {
return $errors;
}
return $entity;
}
}
<?php
namespace WsBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class DefaultController extends Controller
{
public function indexAction()
{
return $this->render('WsBundle:Default:index.html.twig');
}
}
This diff is collapsed.
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace WsBundle\Controller\v1\serializer;
use JMS\Serializer\Annotation\Type;
use Symfony\Component\Validator\Constraints as Assert;
/**
*
* @version 1.0
* @author cdiaz
*/
class szerBodyContenido {
/**
* Id del contenido
* @Type("integer")
* @var integer
*/
private $id;
/**
* id de la fila
* @Type("integer")
* @var integer
*/
private $fila;
/**
* numero de la columna fila
* @Type("integer")
* @var integer
*/
private $columna;
/**
* nombre tipo del contenido
* @Type("string")
* @var integer
*/
private $tipo;
/**
* Contenido a retornar en html
* @Assert\NotNull
* @Type("string")
* @var string
*/
private $contenido;
public function getId() {
return $this->id;
}
public function getFila() {
return $this->fila;
}
public function getColumna() {
return $this->columna;
}
public function getTipo() {
return $this->tipo;
}
public function getContenido() {
return $this->contenido;
}
public function setId($id) {
$this->id = $id;
}
public function setFila($fila) {
$this->fila = $fila;
}
public function setColumna($columna) {
$this->columna = $columna;
}
public function setTipo($tipo) {
$this->tipo = $tipo;
}
public function setContenido($contenido) {
$this->contenido = $contenido;
}
}
<?php
namespace WsBundle\Controller\v1\serializer;
use JMS\Serializer\Annotation\Type;
use Symfony\Component\Validator\Constraints as Assert;
/**
*
* @version 1.0
* @author Cristian Diaz
*/
class szerCampania {
/**
* Id de la campaña
* @Assert\NotBlank
* @Type("integer")
* @var integer
*/
private $id;
public function getId() {
return $this->id;
}
public function setId($id) {
$this->id = $id;
}
}
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace WsBundle\Controller\v1\serializer;
use JMS\Serializer\Annotation\Type;
use Symfony\Component\Validator\Constraints as Assert;
/**
*
* @version 1.0
* @author cdiaz
*/
class szerFooterContenido {
/**
* Id del contenido
* @Type("integer")
* @var integer
*/
private $id;
/**
* id de la fila
* @Type("integer")
* @var integer
*/
private $fila;
/**
* numero de la columna fila
* @Type("integer")
* @var integer
*/
private $columna;
/**
* nombre tipo del contenido
* @Type("string")
* @var integer
*/
private $tipo;
/**
* Contenido a retornar en html
* @Assert\NotNull
* @Type("string")
* @var string
*/
private $contenido;
public function getId() {
return $this->id;
}
public function getFila() {
return $this->fila;
}
public function getColumna() {
return $this->columna;
}
public function getTipo() {
return $this->tipo;
}
public function getContenido() {
return $this->contenido;
}
public function setId($id) {
$this->id = $id;
}
public function setFila($fila) {
$this->fila = $fila;
}
public function setColumna($columna) {
$this->columna = $columna;
}
public function setTipo($tipo) {
$this->tipo = $tipo;
}
public function setContenido($contenido) {
$this->contenido = $contenido;
}
}
This diff is collapsed.
This diff is collapsed.
ws_chat_configuracion:
path: mcafee/campania/obtener/contenido.{_format}
defaults: { _controller: WsBundle:v1\CampaniaApi:obtenerContenido , _format: json}
methods: POST
services:
# ws.example:
# class: WsBundle\Example
# arguments: ["@service_id", "plain_value", "%parameter%"]
<?php
namespace WsBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class WsBundle extends Bundle
{
}
<?php
namespace WsBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testIndex()
{
$client = static::createClient();
$crawler = $client->request('GET', '/');
$this->assertContains('Hello World', $client->getResponse()->getContent());
}
}
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment