public function obtenerPeliculas() { $peliculas = array(); $sql = "select p.id_pelicula,p.titulo,p.sinopsis,p.genero,p.director,por.portada,por.tipo_imagen from peliculas p left join portada por on \n p.id_portada = por.id_portada"; $sp = $this->db->PrepareSP($sql); $rs = $this->db->Execute($sp); while (!$rs->EOF) { $campos = $rs->GetRowAssoc(false); $pelicula = new Pelicula($campos['titulo'], $campos['genero'], $campos['director'], $campos['sinopsis'], $campos['portada'], $campos['tipo_imagen']); $pelicula->setIdPelicula($campos['id_pelicula']); $peliculas[] = $pelicula; $rs->MoveNext(); } return $peliculas; }
public function run() { DB::table('Peliculas')->delete(); Pelicula::create(array('nombre' => 'Avengers 2: Era de Ultrón', 'descripcion' => 'ACTORES: Mark Ruffalo, Chris Evans, Robert Downey Jr. ACTORES SECUNDARIOS: Scarlett Johansson , Elizabeth Olsen, Chris Hemsworth, Cobie Smulders, Jeremy Renner, Samuel L. Jackson, Andy Serkis. DIRECTOR: Joss Whedon.', 'estado' => 'A', 'duracion' => '02:00', 'sipnopsis' => 'Cuando Tony Stark intenta iniciar un programa para garantizar la paz, las cosas se ponen feas y Los Vengadores deberán detener al villano Ultron, que hará todo lo posible por arruinar sus planes.', 'fechaEstreno' => DateTime::createFromFormat('Y-m-d H:i:s', '2015-04-30 23:00:00'), 'funcionarioId' => '1', 'generoId' => '2')); }
/** * Declares an association between this object and a Pelicula object. * * @param Pelicula $v * @return SocioAlquiler The current object (for fluent API support) * @throws PropelException */ public function setPelicula(Pelicula $v = null) { if ($v === null) { $this->setPeliculaId(NULL); } else { $this->setPeliculaId($v->getId()); } $this->aPelicula = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the Pelicula object, it will not be re-added. if ($v !== null) { $v->addSocioAlquiler($this); } return $this; }
/** * Filter the query by a related Pelicula object * * @param Pelicula|PropelCollection $pelicula The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return SocioAlquilerQuery The current query, for fluid interface */ public function filterByPelicula($pelicula, $comparison = null) { if ($pelicula instanceof Pelicula) { return $this->addUsingAlias(SocioAlquilerPeer::PELICULA_ID, $pelicula->getId(), $comparison); } elseif ($pelicula instanceof PropelCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(SocioAlquilerPeer::PELICULA_ID, $pelicula->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByPelicula() only accepts arguments of type Pelicula or PropelCollection'); } }
/** * @param Pelicula $pelicula The pelicula object to add. */ protected function doAddPelicula($pelicula) { $this->collPeliculas[] = $pelicula; $pelicula->setEstadoPelicula($this); }
/** * @param Pelicula $pelicula The pelicula object to add. */ protected function doAddPelicula($pelicula) { $this->collPeliculas[] = $pelicula; $pelicula->setCategoria($this); }
/** * 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 Pelicula the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Pelicula::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
/** * Filter the query by a related Pelicula object * * @param Pelicula $pelicula the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return EstadoPeliculaQuery The current query, for fluid interface */ public function filterByPelicula($pelicula, $comparison = null) { if ($pelicula instanceof Pelicula) { return $this->addUsingAlias(EstadoPeliculaPeer::ID, $pelicula->getEstado(), $comparison); } elseif ($pelicula instanceof PropelCollection) { return $this->usePeliculaQuery()->filterByPrimaryKeys($pelicula->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByPelicula() only accepts arguments of type Pelicula or PropelCollection'); } }
} function ocultar(valor) { // document.getElementById('addpersonaform').style.display="none"; document.getElementById(valor).className = "ocultos"; } </script> <link rel="stylesheet" type="text/css" href="estilo.css" media="screen" /> </head> <body> <?php include_once 'Persona.php'; include_once 'Pelicula.php'; include_once 'Usuario.php'; $respuestas = new Respuestas(); $usuario = new Usuario(); $pelicula = new Pelicula(); $persona = new Persona(); echo '</br>'; $idUsuario = $usuario->dimeId($_SESSION["usu"]); echo " tu id " . $idUsuario; $rolDeUsuario = $usuario->dimeRol($idUsuario); echo '</br>'; echo " tu rol " . $rolDeUsuario; $permisos = $usuario->dimePermisos($rolDeUsuario); $usuario->asignarPermisos($permisos); echo '</br>'; echo " tus permisos; ver:"; var_dump($usuario->permisover); echo '</br>'; echo " tus permisos; insertar:"; var_dump($usuario->permisoinsertar);
/** * Exclude object from result * * @param Pelicula $pelicula Object to remove from the list of results * * @return PeliculaQuery The current query, for fluid interface */ public function prune($pelicula = null) { if ($pelicula) { $this->addUsingAlias(PeliculaPeer::ID, $pelicula->getId(), Criteria::NOT_EQUAL); } return $this; }