/** * 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(Slider_categPeer::DATABASE_NAME, Propel::CONNECTION_WRITE); } $con->beginTransaction(); try { $deleteQuery = Slider_categQuery::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; } }
/** * Get the associated Slider_categ object * * @param PropelPDO Optional Connection object. * @return Slider_categ The associated Slider_categ object. * @throws PropelException */ public function getSlider_categ(PropelPDO $con = null) { if ($this->aSlider_categ === null && $this->id_categoria !== null) { $this->aSlider_categ = Slider_categQuery::create()->findPk($this->id_categoria, $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->aSlider_categ->addSlider_maes($this); */ } return $this->aSlider_categ; }
<?php //die; error_reporting(E_ALL); ini_set("display_errors", 1); include_once "data/config.php"; $libros = LibroQuery::create()->limit(5)->find(); $listaLibros = ""; foreach ($libros as $reg) { $listaLibros .= "<li>" . $reg->getNombre() . "</li>"; } //$sliderItem = Slider_maeQuery::create()->findOneById(1); //$sliderItem->getLibro()->getImage(); //$sliderItem->getLibro()->getNombre(); //Armo los slider $categoriasSlider = Slider_categQuery::create()->limit(4)->find(); $sliders = ""; foreach ($categoriasSlider as $categ) { $sliderMae = Slider_maeQuery::create()->filterById_categoria($categ->getId())->find(); $sliders .= '<div class="col-md-3"> <div><!-- class="box box-solid"--> <div class="box-header"> <h3 class="box-title">' . $categ->getDescrp() . '</h3> </div> <div class="box-body"> <div id="carousel-example-generic-' . $categ->getId() . '" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> '; $pos = 0; $active = ' class="active"'; foreach ($sliderMae as $sliderItem) {