function setNewTypeProduct($data) { $obj = $this->listPasillo; $gPas = isset($_GET['gpas']) ? $_GET['gpas'] : $data['pasillo']; $listPasillo = $obj->offsetGet($gPas); $list = $listPasillo->getTypeProducts(); if (isset($_GET['del'])) { $list->offsetUnset($_GET['del']); } else { $tipoProductos = new TipoProducto(); $tipoProductos->setNameType($data['nomTipo']); $tipoProductos->setListProduct(new SplDoublyLinkedList()); $list->push($tipoProductos); } $_SESSION['listPasillo'] = serialize($obj); header("location: " . $_SERVER['HTTP_REFERER'] . " "); }
<?php include 'valida_acceso.php'; $oTipoProducto = new TipoProducto(); // Lee datos del registro a editar $oProducto = new Producto(); if (isset($_POST["hidcodigo"])) { $oProducto->setId_Producto($_POST["hidcodigo"]); $Registro = $oProducto->LeerRegistro(); } else { echo "Código no especificado."; exit; } ?> <!doctype html> <html lang=''> <head> <meta charset='utf-8'> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/styles.css"> <script src="js/jquery-1.11.2.min.js" type="text/javascript"></script> <title>Editar Producto</title> </head> <body> <?php include 'menu.php'; ?> <div style="text-align: center;width:100%"> <br/> <form id="frmdatos" method="post">
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param TipoProducto $obj A TipoProducto object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool($obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getId(); } // if key === null TipoProductoPeer::$instances[$key] = $obj; } }
/** * Filter the query by a related TipoProducto object * * @param TipoProducto|PropelObjectCollection $tipoProducto 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 * @throws PropelException - if the provided filter is invalid. */ public function filterByTipoProducto($tipoProducto, $comparison = null) { if ($tipoProducto instanceof TipoProducto) { return $this->addUsingAlias(ProductoPeer::TIPO_PRODUCTO_ID, $tipoProducto->getId(), $comparison); } elseif ($tipoProducto instanceof PropelObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(ProductoPeer::TIPO_PRODUCTO_ID, $tipoProducto->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByTipoProducto() only accepts arguments of type TipoProducto or PropelCollection'); } }
private function getListTypePruduct($typeProduct, &$listTypeProducts, &$listProducts) { $tipoProductos = new TipoProducto(); $tipoProductos->setNameType($typeProduct); $tipoProductos->setListProduct($listProducts); $listTypeProducts->push($tipoProductos); $listProducts = new SplDoublyLinkedList(); }
/** * Exclude object from result * * @param TipoProducto $tipoProducto Object to remove from the list of results * * @return TipoProductoQuery The current query, for fluid interface */ public function prune($tipoProducto = null) { if ($tipoProducto) { $this->addUsingAlias(TipoProductoPeer::ID, $tipoProducto->getId(), Criteria::NOT_EQUAL); } return $this; }
/** * Declares an association between this object and a TipoProducto object. * * @param TipoProducto $v * @return Producto The current object (for fluent API support) * @throws PropelException */ public function setTipoProducto(TipoProducto $v = null) { if ($v === null) { $this->setTipoProductoId(NULL); } else { $this->setTipoProductoId($v->getId()); } $this->aTipoProducto = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the TipoProducto object, it will not be re-added. if ($v !== null) { $v->addProducto($this); } return $this; }