public function addDataIndicatores($indicadorBean) { $criteria = new Criteria(); $criteria->add(GroupDataIndicadoresPeer::TREE_ID, $indicadorBean->getTreeId()); $listGrupo = GroupDataIndicadoresPeer::doSelect($criteria); foreach ($listGrupo as $row) { $dataIndicador = new DataIndicadores(); $dataIndicador->setIndicadorId($indicadorBean->getId()); $dataIndicador->setUserId($indicadorBean->getResponsableId()); $dataIndicador->setData(0); $dataIndicador->setGroupData($row->getId()); $dataIndicador->setCreateAt($row->getCreateAt()); $dataIndicador->setUpdateAt($row->getCreateAt()); $dataIndicador->save(); } return array("success" => true, "message" => "exito"); }
/** * Gets an array of GroupDataIndicadores objects which contain a foreign key that references this object. * * If this collection has already been initialized with an identical Criteria, it returns the collection. * Otherwise if this PeriodoSc has previously been saved, it will retrieve * related GroupDataIndicadoress from storage. If this PeriodoSc is new, it will return * an empty collection or the current collection, the criteria is ignored on a new object. * * @param PropelPDO $con * @param Criteria $criteria * @return array GroupDataIndicadores[] * @throws PropelException */ public function getGroupDataIndicadoress($criteria = null, PropelPDO $con = null) { if ($criteria === null) { $criteria = new Criteria(PeriodoScPeer::DATABASE_NAME); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collGroupDataIndicadoress === null) { if ($this->isNew()) { $this->collGroupDataIndicadoress = array(); } else { $criteria->add(GroupDataIndicadoresPeer::PERIODO_ID, $this->id); GroupDataIndicadoresPeer::addSelectColumns($criteria); $this->collGroupDataIndicadoress = GroupDataIndicadoresPeer::doSelect($criteria, $con); } } else { // criteria has no effect for a new object if (!$this->isNew()) { // the following code is to determine if a new query is // called for. If the criteria is the same as the last // one, just return the collection. $criteria->add(GroupDataIndicadoresPeer::PERIODO_ID, $this->id); GroupDataIndicadoresPeer::addSelectColumns($criteria); if (!isset($this->lastGroupDataIndicadoresCriteria) || !$this->lastGroupDataIndicadoresCriteria->equals($criteria)) { $this->collGroupDataIndicadoress = GroupDataIndicadoresPeer::doSelect($criteria, $con); } } } $this->lastGroupDataIndicadoresCriteria = $criteria; return $this->collGroupDataIndicadoress; }
/** * Retrieve multiple objects by pkey. * * @param array $pks List of primary keys * @param PropelPDO $con the connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(GroupDataIndicadoresPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(GroupDataIndicadoresPeer::DATABASE_NAME); $criteria->add(GroupDataIndicadoresPeer::ID, $pks, Criteria::IN); $objs = GroupDataIndicadoresPeer::doSelect($criteria, $con); } return $objs; }