/** * Returns a new Tipo_notificacionQuery object. * * @param string $modelAlias The alias of a model in the query * @param Criteria $criteria Optional Criteria to build the query from * * @return Tipo_notificacionQuery */ public static function create($modelAlias = null, $criteria = null) { if ($criteria instanceof Tipo_notificacionQuery) { return $criteria; } $query = new Tipo_notificacionQuery(); if (null !== $modelAlias) { $query->setModelAlias($modelAlias); } if ($criteria instanceof Criteria) { $query->mergeWith($criteria); } return $query; }
/** * Get the associated Tipo_notificacion object * * @param PropelPDO Optional Connection object. * @return Tipo_notificacion The associated Tipo_notificacion object. * @throws PropelException */ public function getTipo_notificacion(PropelPDO $con = null) { if ($this->aTipo_notificacion === null && $this->id_tipo_notificacion !== null) { $this->aTipo_notificacion = Tipo_notificacionQuery::create()->findPk($this->id_tipo_notificacion, $con); /* The following can be used additionally to guarantee the related object contains a reference to this object. This level of coupling may, however, be undesirable since it could result in an only partially populated collection in the referenced object. $this->aTipo_notificacion->addNotificacions($this); */ } return $this->aTipo_notificacion; }
/** * Removes this object from datastore and sets delete attribute. * * @param PropelPDO $con * @return void * @throws PropelException * @see BaseObject::setDeleted() * @see BaseObject::isDeleted() */ public function delete(PropelPDO $con = null) { if ($this->isDeleted()) { throw new PropelException("This object has already been deleted."); } if ($con === null) { $con = Propel::getConnection(Tipo_notificacionPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); } $con->beginTransaction(); try { $deleteQuery = Tipo_notificacionQuery::create()->filterByPrimaryKey($this->getPrimaryKey()); $ret = $this->preDelete($con); if ($ret) { $deleteQuery->delete($con); $this->postDelete($con); $con->commit(); $this->setDeleted(true); } else { $con->commit(); } } catch (Exception $e) { $con->rollBack(); throw $e; } }
echo json_encode(array('error' => 0, 'msg' => "")); break; case "5": //Aceptacion de amistad $generoObj = Tipo_notificacionQuery::create()->findOneById($datos->id); $generoObj->setNombre($datos->nombre); $generoObj->save(); echo json_encode(array('error' => 0, 'msg' => "Te han aceptado una solicitud de amistad")); break; case "6": //Subir un PDF $generoObj = Tipo_notificacionQuery::create()->findOneById($datos->id); $generoObj->setNombre($datos->nombre); $generoObj->save(); echo json_encode(array('error' => 0, 'msg' => "Se ha subido un archivo PDF")); break; case "7": //denuncia $generoObj = Tipo_notificacionQuery::create()->findOneById($datos->id); $generoObj->setNombre($datos->nombre); $generoObj->save(); echo json_encode(array('error' => 0, 'msg' => "Se ha denunciado una publicacion")); break; case "8": //Recomendacion de libro $generoObj = Tipo_notificacionQuery::create()->findOneById($datos->id); $generoObj->setNombre($datos->nombre); $generoObj->save(); echo json_encode(array('error' => 0, 'msg' => "Se ha recomendado un libro tuyo")); break; }