function getListEventoArtistaLugar($condicion = NULL, $parametros = array()) { if ($condicion === null) { $condicion = ""; } else { // $condicion="where $condicion"; $condicion = $condicion; } /**$sql ="SELECT e.*, l.*, a.* from evento e inner join lugar l on e.ID_lugar=l.ID_lugar inner join artista a on e.ID_artista=a.ID_artista $condicion ;";*/ $sql = "SELECT *\nfrom evento e, artista a\nwhere e.ID_artista=a.ID_artista and {$condicion}"; echo "<BR>COLSUTA: " . $sql . "<BR>"; $this->bd->send($sql, $parametros); $r = array(); $contador = 0; while ($fila = $this->bd->getRow()) { $evento = new Evento(); $evento->set($fila); $lugar = new Lugar(); $lugar->set($fila, 6); $artista = new Artista(); $artista->set($fila, 9); $r[$contador]["evento"] = $evento; $r[$contador]["artista"] = $artista; $r[$contador]["lugar"] = $lugar; $contador++; return $r; } }
function getList() { $this->bd->select($this->tabla, '*', "1=1", array(), "ID_artista, nombre_artista"); $r = array(); while ($fila = $this->bd->getRow()) { $artista = new Artista(); $artista->set($fila); $r[] = $artista; } return $r; }
public function getListPage($paginaActual = 0, $nrpp = Constant::NRPP) { $this->bd->select($this->tabla, "*", "1=1", array(), "email, alias", "{$paginaActual},{$nrpp}"); $r = array(); while ($fila = $this->bd->getRow()) { $artista = new Artista(); $artista->set($fila); $r[] = $artista; } return $r; }
/** * Exclude object from result * * @param Artista $artista Object to remove from the list of results * * @return ArtistaQuery The current query, for fluid interface */ public function prune($artista = null) { if ($artista) { $this->addUsingAlias(ArtistaPeer::IDARTISTA, $artista->getIdartista(), Criteria::NOT_EQUAL); } return $this; }
function getList($pagina = 1, $orden = "", $nrpp = Constants::NRPP, $condicion = "1=1", $parametros = array()) { $ordenPredeterminado = "{$orden}, fechaalta, email"; if (trim($orden) === "" || trim($orden) === null) { $ordenPredeterminado = "fechaalta, email"; } $registroInicial = ($pagina - 1) * $nrpp; $this->bd->select($this->tabla, "*", $condicion, $parametros, $ordenPredeterminado, "{$registroInicial}, {$nrpp}"); $r = array(); while ($fila = $this->bd->getRow()) { $artista = new Artista(); $artista->set($fila); $r[] = $artista; } return $r; }
private static function setArtista($gestor, $sesion) { $artista = new Artista(); $artista->read(); $artista->setClave(sha1($artista->getClave())); if ($gestor->set($artista, $artista->getEmail())) { self::addArtista($gestor, $sesion, "Realizado con exito"); } else { self::addArtista($gestor, $sesion, "Algun dato fallo al intentar modificarse" . var_dump($artista)); } }
/** * Filter the query by a related Artista object * * @param Artista|PropelCollection $artista The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ProductoQuery The current query, for fluid interface */ public function filterByArtista($artista, $comparison = null) { if ($artista instanceof Artista) { return $this->addUsingAlias(ProductoPeer::IDARTISTA, $artista->getIdartista(), $comparison); } elseif ($artista instanceof PropelCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(ProductoPeer::IDARTISTA, $artista->toKeyValue('PrimaryKey', 'Idartista'), $comparison); } else { throw new PropelException('filterByArtista() only accepts arguments of type Artista or PropelCollection'); } }
function getList2($pagina = 1, $nrpp = Constant::NRPP) { $registroInicial = ($pagina - 1) * $nrpp; $this->bd->select($this->tabla, "*", "1=1", array(), "email, alias", "{$registroInicial}, {$nrpp}"); $r = array(); while ($fila = $this->bd->getRow()) { $artista = new Artista(); $artista->set($fila); $r[] = $artista; } return $r; }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Artista the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Artista::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<?php //echo $form->textField($model,'tipousuario'); > echo $form->dropDownList($model, 'idiomaid', CHtml::listData(Idiomas::model()->findAll(), 'id', 'nombre'), array('empty' => 'Seleccione')); ?> <?php echo $form->error($model, 'idiomaid'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'artistaid'); ?> <?php //echo $form->textField($model,'tipousuario'); > echo $form->dropDownList($model, 'artistaid', CHtml::listData(Artista::model()->findAll(), 'idartista', 'concatened'), array('empty' => 'Seleccione')); ?> <?php echo $form->error($model, 'artistaid'); ?> </div> <div class="row"> <?php echo $form->labelEx($model, 'pais'); ?> <?php echo $form->textField($model, 'pais', array('size' => 20, 'maxlength' => 255)); ?> <?php echo $form->error($model, 'pais');
public function actionArtist($id) { $idioma = Idiomas::model()->find('idioma=:idioma', array(':idioma' => Yii::app()->language)); //datos del artista if ($idioma->idioma == Yii::app()->params->idiomas['Español']) { //español $criteria = new CDbCriteria(); $criteria->select = 't.*'; $criteria->condition = 't.idartista =:id'; $criteria->params = array(':id' => $id); } else { //ingles $criteria = new CDbCriteria(); $criteria->select = 't.*, tra_artista.*'; $criteria->together = true; $criteria->join = 'LEFT JOIN tra_artista ON tra_artista.artistaid = t.idartista'; $criteria->condition = 'tra_artista.idiomaid =:ididioma and t.idartista = :id'; $criteria->params = array(':ididioma' => $idioma->id, ':id' => $id); } $artista = Artista::model()->find($criteria); //prensa if ($idioma->idioma == Yii::app()->params->idiomas['Español']) { //español $criteria = new CDbCriteria(); $criteria->select = 't.*, artista_prensa.*'; $criteria->together = true; $criteria->join = 'LEFT JOIN artista_prensa ON artista_prensa.idprensa = t.idprensa'; $criteria->condition = 'artista_prensa.idartista =:id'; $criteria->params = array(':id' => $id); $criteria->order = 'fecha DESC'; } else { $criteria = new CDbCriteria(); $criteria->select = 't.*, artista_prensa.*, tra_prensa.*'; $criteria->together = true; $criteria->join = 'LEFT JOIN artista_prensa ON artista_prensa.idprensa = t.idprensa LEFT JOIN tra_prensa ON tra_prensa.prensaid = t.idprensa'; $criteria->condition = 'tra_prensa.idiomaid =:idioma and artista_prensa.idartista =:id'; $criteria->params = array(':id' => $id, ':idioma' => $idioma->id); $criteria->order = 't.fecha DESC'; $criteria->group = 't.idprensa'; } $prensas = Prensa::model()->findAll($criteria); if ($idioma->idioma == Yii::app()->params->idiomas['Español']) { //español $criteria = new CDbCriteria(); $criteria->select = 't.*'; $criteria->group = 't.descripcion'; $criteria->distinct = true; $criteria->condition = 't.idartista =:idartista'; $criteria->params = array(':idartista' => $id); } else { //obras $criteria = new CDbCriteria(); $criteria->select = 't.*, tra_obra.*'; $criteria->condition = 't.idartista =:idartista'; $criteria->group = 't.descripcion'; $criteria->distinct = true; $criteria->join = 'LEFT JOIN tra_obra ON tra_obra.obraid = t.idobra AND tra_obra.idiomaid=:ididioma'; $criteria->params = array(':idartista' => $id, ':ididioma' => $idioma->id); } $obras = Obra::model()->findAll($criteria); $this->render('artista', array('artista' => $artista, 'idioma' => $idioma, 'obras' => $obras, 'prensas' => $prensas)); }
public function getInfo() { $info = parent::getInfo(); return [$info[0], $info[1], $this->genero]; }
/** * Declares an association between this object and a Artista object. * * @param Artista $v * @return Producto The current object (for fluent API support) * @throws PropelException */ public function setArtista(Artista $v = null) { if ($v === null) { $this->setIdartista(NULL); } else { $this->setIdartista($v->getIdartista()); } $this->aArtista = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the Artista object, it will not be re-added. if ($v !== null) { $v->addProducto($this); } return $this; }