Commit e278cb59 authored by Ana's avatar Ana

añadir grabado de status

parent f2db3651
......@@ -3,9 +3,10 @@
<database name="default" defaultIdMethod="native">
<table name="notifica" phpName="Notifica" idMethod="native">
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="campana" phpName="Campana" type="INTEGER" required="true"/>
<column name="campana" phpName="Campana" type="CLOB" required="true"/>
<column name="telefono" phpName="Telefono" type="VARCHAR" size="20" required="true"/>
<column name="estado" phpName="Estado" type="INTEGER" required="true"/>
<column name="estado" phpName="Estado" type="LONGVARCHAR" required="true"/>
<column name="idmetodo" phpName="Idmetodo" type="INTEGER" required="true" defaultValue="0"/>
<vendor type="mysql">
<parameter name="Engine" value="MyISAM"/>
</vendor>
......
......@@ -31,9 +31,10 @@ SET time_zone = "+00:00";
CREATE TABLE `notifica` (
`id` int(11) NOT NULL,
`campana` int(11) NOT NULL,
`campana` longtext NOT NULL,
`telefono` varchar(20) NOT NULL,
`estado` int(11) NOT NULL
`estado` text NOT NULL,
`idmetodo` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
......
......@@ -43,9 +43,10 @@ class NotificaTableMap extends TableMap
$this->setUseIdGenerator(true);
// columns
$this->addPrimaryKey('id', 'Id', 'INTEGER', true, null, null);
$this->addColumn('campana', 'Campana', 'INTEGER', true, null, null);
$this->addColumn('campana', 'Campana', 'CLOB', true, null, null);
$this->addColumn('telefono', 'Telefono', 'VARCHAR', true, 20, null);
$this->addColumn('estado', 'Estado', 'INTEGER', true, null, null);
$this->addColumn('estado', 'Estado', 'LONGVARCHAR', true, null, null);
$this->addColumn('idmetodo', 'Idmetodo', 'INTEGER', true, null, 0);
// validators
} // initialize()
......
......@@ -44,7 +44,7 @@ abstract class BaseNotifica extends BaseObject implements Persistent
/**
* The value for the campana field.
* @var int
* @var string
*/
protected $campana;
......@@ -56,10 +56,17 @@ abstract class BaseNotifica extends BaseObject implements Persistent
/**
* The value for the estado field.
* @var int
* @var string
*/
protected $estado;
/**
* The value for the idmetodo field.
* Note: this column has a database default value of: 0
* @var int
*/
protected $idmetodo;
/**
* Flag to prevent endless save loop, if this object is referenced
* by another object which falls in this transaction.
......@@ -80,6 +87,27 @@ abstract class BaseNotifica extends BaseObject implements Persistent
*/
protected $alreadyInClearAllReferencesDeep = false;
/**
* Applies default values to this object.
* This method should be called from the object's constructor (or
* equivalent initialization method).
* @see __construct()
*/
public function applyDefaultValues()
{
$this->idmetodo = 0;
}
/**
* Initializes internal state of BaseNotifica object.
* @see applyDefaults()
*/
public function __construct()
{
parent::__construct();
$this->applyDefaultValues();
}
/**
* Get the [id] column value.
*
......@@ -94,7 +122,7 @@ abstract class BaseNotifica extends BaseObject implements Persistent
/**
* Get the [campana] column value.
*
* @return int
* @return string
*/
public function getCampana()
{
......@@ -116,7 +144,7 @@ abstract class BaseNotifica extends BaseObject implements Persistent
/**
* Get the [estado] column value.
*
* @return int
* @return string
*/
public function getEstado()
{
......@@ -124,6 +152,17 @@ abstract class BaseNotifica extends BaseObject implements Persistent
return $this->estado;
}
/**
* Get the [idmetodo] column value.
*
* @return int
*/
public function getIdmetodo()
{
return $this->idmetodo;
}
/**
* Set the value of [id] column.
*
......@@ -148,13 +187,13 @@ abstract class BaseNotifica extends BaseObject implements Persistent
/**
* Set the value of [campana] column.
*
* @param int $v new value
* @param string $v new value
* @return Notifica The current object (for fluent API support)
*/
public function setCampana($v)
{
if ($v !== null && is_numeric($v)) {
$v = (int) $v;
if ($v !== null) {
$v = (string) $v;
}
if ($this->campana !== $v) {
......@@ -190,13 +229,13 @@ abstract class BaseNotifica extends BaseObject implements Persistent
/**
* Set the value of [estado] column.
*
* @param int $v new value
* @param string $v new value
* @return Notifica The current object (for fluent API support)
*/
public function setEstado($v)
{
if ($v !== null && is_numeric($v)) {
$v = (int) $v;
if ($v !== null) {
$v = (string) $v;
}
if ($this->estado !== $v) {
......@@ -208,6 +247,27 @@ abstract class BaseNotifica extends BaseObject implements Persistent
return $this;
} // setEstado()
/**
* Set the value of [idmetodo] column.
*
* @param int $v new value
* @return Notifica The current object (for fluent API support)
*/
public function setIdmetodo($v)
{
if ($v !== null && is_numeric($v)) {
$v = (int) $v;
}
if ($this->idmetodo !== $v) {
$this->idmetodo = $v;
$this->modifiedColumns[] = NotificaPeer::IDMETODO;
}
return $this;
} // setIdmetodo()
/**
* Indicates whether the columns in this object are only set to default values.
*
......@@ -218,6 +278,10 @@ abstract class BaseNotifica extends BaseObject implements Persistent
*/
public function hasOnlyDefaultValues()
{
if ($this->idmetodo !== 0) {
return false;
}
// otherwise, everything was equal, so return true
return true;
} // hasOnlyDefaultValues()
......@@ -241,9 +305,10 @@ abstract class BaseNotifica extends BaseObject implements Persistent
try {
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->campana = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
$this->campana = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
$this->telefono = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->estado = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
$this->estado = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
$this->idmetodo = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
$this->resetModified();
$this->setNew(false);
......@@ -253,7 +318,7 @@ abstract class BaseNotifica extends BaseObject implements Persistent
}
$this->postHydrate($row, $startcol, $rehydrate);
return $startcol + 4; // 4 = NotificaPeer::NUM_HYDRATE_COLUMNS.
return $startcol + 5; // 5 = NotificaPeer::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating Notifica object", $e);
......@@ -477,6 +542,9 @@ abstract class BaseNotifica extends BaseObject implements Persistent
if ($this->isColumnModified(NotificaPeer::ESTADO)) {
$modifiedColumns[':p' . $index++] = '`estado`';
}
if ($this->isColumnModified(NotificaPeer::IDMETODO)) {
$modifiedColumns[':p' . $index++] = '`idmetodo`';
}
$sql = sprintf(
'INSERT INTO `notifica` (%s) VALUES (%s)',
......@@ -492,13 +560,16 @@ abstract class BaseNotifica extends BaseObject implements Persistent
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break;
case '`campana`':
$stmt->bindValue($identifier, $this->campana, PDO::PARAM_INT);
$stmt->bindValue($identifier, $this->campana, PDO::PARAM_STR);
break;
case '`telefono`':
$stmt->bindValue($identifier, $this->telefono, PDO::PARAM_STR);
break;
case '`estado`':
$stmt->bindValue($identifier, $this->estado, PDO::PARAM_INT);
$stmt->bindValue($identifier, $this->estado, PDO::PARAM_STR);
break;
case '`idmetodo`':
$stmt->bindValue($identifier, $this->idmetodo, PDO::PARAM_INT);
break;
}
}
......@@ -646,6 +717,9 @@ abstract class BaseNotifica extends BaseObject implements Persistent
case 3:
return $this->getEstado();
break;
case 4:
return $this->getIdmetodo();
break;
default:
return null;
break;
......@@ -678,6 +752,7 @@ abstract class BaseNotifica extends BaseObject implements Persistent
$keys[1] => $this->getCampana(),
$keys[2] => $this->getTelefono(),
$keys[3] => $this->getEstado(),
$keys[4] => $this->getIdmetodo(),
);
$virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) {
......@@ -729,6 +804,9 @@ abstract class BaseNotifica extends BaseObject implements Persistent
case 3:
$this->setEstado($value);
break;
case 4:
$this->setIdmetodo($value);
break;
} // switch()
}
......@@ -757,6 +835,7 @@ abstract class BaseNotifica extends BaseObject implements Persistent
if (array_key_exists($keys[1], $arr)) $this->setCampana($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setTelefono($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setEstado($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setIdmetodo($arr[$keys[4]]);
}
/**
......@@ -772,6 +851,7 @@ abstract class BaseNotifica extends BaseObject implements Persistent
if ($this->isColumnModified(NotificaPeer::CAMPANA)) $criteria->add(NotificaPeer::CAMPANA, $this->campana);
if ($this->isColumnModified(NotificaPeer::TELEFONO)) $criteria->add(NotificaPeer::TELEFONO, $this->telefono);
if ($this->isColumnModified(NotificaPeer::ESTADO)) $criteria->add(NotificaPeer::ESTADO, $this->estado);
if ($this->isColumnModified(NotificaPeer::IDMETODO)) $criteria->add(NotificaPeer::IDMETODO, $this->idmetodo);
return $criteria;
}
......@@ -838,6 +918,7 @@ abstract class BaseNotifica extends BaseObject implements Persistent
$copyObj->setCampana($this->getCampana());
$copyObj->setTelefono($this->getTelefono());
$copyObj->setEstado($this->getEstado());
$copyObj->setIdmetodo($this->getIdmetodo());
if ($makeNew) {
$copyObj->setNew(true);
$copyObj->setId(NULL); // this is a auto-increment column, so set to default value
......@@ -893,10 +974,12 @@ abstract class BaseNotifica extends BaseObject implements Persistent
$this->campana = null;
$this->telefono = null;
$this->estado = null;
$this->idmetodo = null;
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->alreadyInClearAllReferencesDeep = false;
$this->clearAllReferences();
$this->applyDefaultValues();
$this->resetModified();
$this->setNew(true);
$this->setDeleted(false);
......
......@@ -29,13 +29,13 @@ abstract class BaseNotificaPeer
const TM_CLASS = 'AppBundle\\Model\\map\\NotificaTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 4;
const NUM_COLUMNS = 5;
/** 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 = 4;
const NUM_HYDRATE_COLUMNS = 5;
/** the column name for the id field */
const ID = 'notifica.id';
......@@ -49,6 +49,9 @@ abstract class BaseNotificaPeer
/** the column name for the estado field */
const ESTADO = 'notifica.estado';
/** the column name for the idmetodo field */
const IDMETODO = 'notifica.idmetodo';
/** The default string format for model objects of the related table **/
const DEFAULT_STRING_FORMAT = 'YAML';
......@@ -68,12 +71,12 @@ abstract class BaseNotificaPeer
* e.g. NotificaPeer::$fieldNames[NotificaPeer::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('Id', 'Campana', 'Telefono', 'Estado', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'campana', 'telefono', 'estado', ),
BasePeer::TYPE_COLNAME => array (NotificaPeer::ID, NotificaPeer::CAMPANA, NotificaPeer::TELEFONO, NotificaPeer::ESTADO, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'CAMPANA', 'TELEFONO', 'ESTADO', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'campana', 'telefono', 'estado', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
BasePeer::TYPE_PHPNAME => array ('Id', 'Campana', 'Telefono', 'Estado', 'Idmetodo', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'campana', 'telefono', 'estado', 'idmetodo', ),
BasePeer::TYPE_COLNAME => array (NotificaPeer::ID, NotificaPeer::CAMPANA, NotificaPeer::TELEFONO, NotificaPeer::ESTADO, NotificaPeer::IDMETODO, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'CAMPANA', 'TELEFONO', 'ESTADO', 'IDMETODO', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'campana', 'telefono', 'estado', 'idmetodo', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
);
/**
......@@ -83,12 +86,12 @@ abstract class BaseNotificaPeer
* e.g. NotificaPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Campana' => 1, 'Telefono' => 2, 'Estado' => 3, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'campana' => 1, 'telefono' => 2, 'estado' => 3, ),
BasePeer::TYPE_COLNAME => array (NotificaPeer::ID => 0, NotificaPeer::CAMPANA => 1, NotificaPeer::TELEFONO => 2, NotificaPeer::ESTADO => 3, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'CAMPANA' => 1, 'TELEFONO' => 2, 'ESTADO' => 3, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'campana' => 1, 'telefono' => 2, 'estado' => 3, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Campana' => 1, 'Telefono' => 2, 'Estado' => 3, 'Idmetodo' => 4, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'campana' => 1, 'telefono' => 2, 'estado' => 3, 'idmetodo' => 4, ),
BasePeer::TYPE_COLNAME => array (NotificaPeer::ID => 0, NotificaPeer::CAMPANA => 1, NotificaPeer::TELEFONO => 2, NotificaPeer::ESTADO => 3, NotificaPeer::IDMETODO => 4, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'CAMPANA' => 1, 'TELEFONO' => 2, 'ESTADO' => 3, 'IDMETODO' => 4, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'campana' => 1, 'telefono' => 2, 'estado' => 3, 'idmetodo' => 4, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
);
/**
......@@ -166,11 +169,13 @@ abstract class BaseNotificaPeer
$criteria->addSelectColumn(NotificaPeer::CAMPANA);
$criteria->addSelectColumn(NotificaPeer::TELEFONO);
$criteria->addSelectColumn(NotificaPeer::ESTADO);
$criteria->addSelectColumn(NotificaPeer::IDMETODO);
} else {
$criteria->addSelectColumn($alias . '.id');
$criteria->addSelectColumn($alias . '.campana');
$criteria->addSelectColumn($alias . '.telefono');
$criteria->addSelectColumn($alias . '.estado');
$criteria->addSelectColumn($alias . '.idmetodo');
}
}
......
......@@ -19,11 +19,13 @@ use AppBundle\Model\NotificaQuery;
* @method NotificaQuery orderByCampana($order = Criteria::ASC) Order by the campana column
* @method NotificaQuery orderByTelefono($order = Criteria::ASC) Order by the telefono column
* @method NotificaQuery orderByEstado($order = Criteria::ASC) Order by the estado column
* @method NotificaQuery orderByIdmetodo($order = Criteria::ASC) Order by the idmetodo column
*
* @method NotificaQuery groupById() Group by the id column
* @method NotificaQuery groupByCampana() Group by the campana column
* @method NotificaQuery groupByTelefono() Group by the telefono column
* @method NotificaQuery groupByEstado() Group by the estado column
* @method NotificaQuery groupByIdmetodo() Group by the idmetodo column
*
* @method NotificaQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method NotificaQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
......@@ -32,14 +34,16 @@ use AppBundle\Model\NotificaQuery;
* @method Notifica findOne(PropelPDO $con = null) Return the first Notifica matching the query
* @method Notifica findOneOrCreate(PropelPDO $con = null) Return the first Notifica matching the query, or a new Notifica object populated from the query conditions when no match is found
*
* @method Notifica findOneByCampana(int $campana) Return the first Notifica filtered by the campana column
* @method Notifica findOneByCampana(string $campana) Return the first Notifica filtered by the campana column
* @method Notifica findOneByTelefono(string $telefono) Return the first Notifica filtered by the telefono column
* @method Notifica findOneByEstado(int $estado) Return the first Notifica filtered by the estado column
* @method Notifica findOneByEstado(string $estado) Return the first Notifica filtered by the estado column
* @method Notifica findOneByIdmetodo(int $idmetodo) Return the first Notifica filtered by the idmetodo column
*
* @method array findById(int $id) Return Notifica objects filtered by the id column
* @method array findByCampana(int $campana) Return Notifica objects filtered by the campana column
* @method array findByCampana(string $campana) Return Notifica objects filtered by the campana column
* @method array findByTelefono(string $telefono) Return Notifica objects filtered by the telefono column
* @method array findByEstado(int $estado) Return Notifica objects filtered by the estado column
* @method array findByEstado(string $estado) Return Notifica objects filtered by the estado column
* @method array findByIdmetodo(int $idmetodo) Return Notifica objects filtered by the idmetodo column
*/
abstract class BaseNotificaQuery extends ModelCriteria
{
......@@ -145,7 +149,7 @@ abstract class BaseNotificaQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT `id`, `campana`, `telefono`, `estado` FROM `notifica` WHERE `id` = :p0';
$sql = 'SELECT `id`, `campana`, `telefono`, `estado`, `idmetodo` FROM `notifica` WHERE `id` = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
......@@ -281,37 +285,24 @@ abstract class BaseNotificaQuery extends ModelCriteria
*
* Example usage:
* <code>
* $query->filterByCampana(1234); // WHERE campana = 1234
* $query->filterByCampana(array(12, 34)); // WHERE campana IN (12, 34)
* $query->filterByCampana(array('min' => 12)); // WHERE campana >= 12
* $query->filterByCampana(array('max' => 12)); // WHERE campana <= 12
* $query->filterByCampana('fooValue'); // WHERE campana = 'fooValue'
* $query->filterByCampana('%fooValue%'); // WHERE campana LIKE '%fooValue%'
* </code>
*
* @param mixed $campana 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 $campana The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return NotificaQuery The current query, for fluid interface
*/
public function filterByCampana($campana = null, $comparison = null)
{
if (is_array($campana)) {
$useMinMax = false;
if (isset($campana['min'])) {
$this->addUsingAlias(NotificaPeer::CAMPANA, $campana['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($campana['max'])) {
$this->addUsingAlias(NotificaPeer::CAMPANA, $campana['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
if (is_array($campana)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $campana)) {
$campana = str_replace('*', '%', $campana);
$comparison = Criteria::LIKE;
}
}
......@@ -352,13 +343,42 @@ abstract class BaseNotificaQuery extends ModelCriteria
*
* Example usage:
* <code>
* $query->filterByEstado(1234); // WHERE estado = 1234
* $query->filterByEstado(array(12, 34)); // WHERE estado IN (12, 34)
* $query->filterByEstado(array('min' => 12)); // WHERE estado >= 12
* $query->filterByEstado(array('max' => 12)); // WHERE estado <= 12
* $query->filterByEstado('fooValue'); // WHERE estado = 'fooValue'
* $query->filterByEstado('%fooValue%'); // WHERE estado LIKE '%fooValue%'
* </code>
*
* @param mixed $estado The value to use as filter.
* @param string $estado The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return NotificaQuery The current query, for fluid interface
*/
public function filterByEstado($estado = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($estado)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $estado)) {
$estado = str_replace('*', '%', $estado);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(NotificaPeer::ESTADO, $estado, $comparison);
}
/**
* Filter the query on the idmetodo column
*
* Example usage:
* <code>
* $query->filterByIdmetodo(1234); // WHERE idmetodo = 1234
* $query->filterByIdmetodo(array(12, 34)); // WHERE idmetodo IN (12, 34)
* $query->filterByIdmetodo(array('min' => 12)); // WHERE idmetodo >= 12
* $query->filterByIdmetodo(array('max' => 12)); // WHERE idmetodo <= 12
* </code>
*
* @param mixed $idmetodo 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.
......@@ -366,16 +386,16 @@ abstract class BaseNotificaQuery extends ModelCriteria
*
* @return NotificaQuery The current query, for fluid interface
*/
public function filterByEstado($estado = null, $comparison = null)
public function filterByIdmetodo($idmetodo = null, $comparison = null)
{
if (is_array($estado)) {
if (is_array($idmetodo)) {
$useMinMax = false;
if (isset($estado['min'])) {
$this->addUsingAlias(NotificaPeer::ESTADO, $estado['min'], Criteria::GREATER_EQUAL);
if (isset($idmetodo['min'])) {
$this->addUsingAlias(NotificaPeer::IDMETODO, $idmetodo['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($estado['max'])) {
$this->addUsingAlias(NotificaPeer::ESTADO, $estado['max'], Criteria::LESS_EQUAL);
if (isset($idmetodo['max'])) {
$this->addUsingAlias(NotificaPeer::IDMETODO, $idmetodo['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
......@@ -386,7 +406,7 @@ abstract class BaseNotificaQuery extends ModelCriteria
}
}
return $this->addUsingAlias(NotificaPeer::ESTADO, $estado, $comparison);
return $this->addUsingAlias(NotificaPeer::IDMETODO, $idmetodo, $comparison);
}
/**
......
<?xml version="1.0" encoding="utf-8"?>
<!--Autogenerated by PropelSchemaReverseTask class.-->
<database name="default" defaultIdMethod="native" namespace="AppBundle\Model">
<table name="notifica" phpName="Notifica" idMethod="native">
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="campana" phpName="Campana" type="INTEGER" required="true"/>
<column name="campana" phpName="Campana" type="CLOB" required="true"/>
<column name="telefono" phpName="Telefono" type="VARCHAR" size="20" required="true"/>
<column name="estado" phpName="Estado" type="INTEGER" required="true"/>
<column name="estado" phpName="Estado" type="LONGVARCHAR" required="true"/>
<column name="idmetodo" phpName="Idmetodo" type="INTEGER" required="true" defaultValue="0"/>
<vendor type="mysql">
<parameter name="Engine" value="MyISAM"/>
</vendor>
......
......@@ -177,8 +177,22 @@ class EnvioSmsController extends FOSRestController {
'startTime' => $time,
]);
$estado = '';
$telefono = '';
if ($result['events']) {
$status = json_decode($result['events'][0]['message'], true);
$telefono= $status['delivery']['destination'];
$estado= $status['status'];
$notifica = new Notifica();
$notifica->setCampana($messageId);
$notifica->setTelefono($telefono);
$notifica->setEstado($estado);
$notifica->setIdMetodo(3);
$notifica->save();
return $result;
} else {
$result = $cloud2->filterLogEvents([
......@@ -187,7 +201,20 @@ class EnvioSmsController extends FOSRestController {
'startTime' => $time,
]);
$estado = '';
$telefono = '';
if ($result['events']) {
$status = json_decode($result['events'][0]['message'], true);
$telefono= $status['delivery']['destination'];
$estado= $status['status'];
$notifica = new Notifica();
$notifica->setCampana($messageId);
$notifica->setTelefono($telefono);
$notifica->setEstado($estado);
$notifica->setIdMetodo(3);
$notifica->save();
return $result;
} else {
$resp = array(
......@@ -198,6 +225,8 @@ class EnvioSmsController extends FOSRestController {
return $resp;
}
}
}
/**
......
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