/** * Resets all references to other model objects or collections of model objects. * * This method is a user-space workaround for PHP's inability to garbage collect * objects with circular references (even in PHP 5.3). This is currently necessary * when using Propel in certain daemon or large-volume/high-memory operations. * * @param boolean $deep Whether to also clear the references on all referrer objects. */ public function clearAllReferences($deep = false) { if ($deep && !$this->alreadyInClearAllReferencesDeep) { $this->alreadyInClearAllReferencesDeep = true; if ($this->collBarangMasuks) { foreach ($this->collBarangMasuks as $o) { $o->clearAllReferences($deep); } } if ($this->aKota instanceof Persistent) { $this->aKota->clearAllReferences($deep); } $this->alreadyInClearAllReferencesDeep = false; } // if ($deep) if ($this->collBarangMasuks instanceof PropelCollection) { $this->collBarangMasuks->clearIterator(); } $this->collBarangMasuks = null; $this->aKota = null; }
protected function findModelkota($id) { if (($model = Kota::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * 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 Kota $obj A Kota 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 KotaPeer::$instances[$key] = $obj; } }
public function getCustkota() { return $this->hasOne(Kota::className(), ['POSTAL_CODE' => 'CITY_ID']); }
/** * 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 Kota the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Kota::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
/** * Filter the query by a related Kota object * * @param Kota|PropelObjectCollection $kota The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return CustomersQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByKota($kota, $comparison = null) { if ($kota instanceof Kota) { return $this->addUsingAlias(CustomersPeer::ID_KOTA, $kota->getId(), $comparison); } elseif ($kota instanceof PropelObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(CustomersPeer::ID_KOTA, $kota->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByKota() only accepts arguments of type Kota or PropelCollection'); } }
/** * @param Kota $kota The kota object to add. */ protected function doAddKota($kota) { $this->collKotas[] = $kota; $kota->setPropinsi($this); }
/** * Filter the query by a related Kota object * * @param Kota|PropelObjectCollection $kota the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return PropinsiQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByKota($kota, $comparison = null) { if ($kota instanceof Kota) { return $this->addUsingAlias(PropinsiPeer::ID, $kota->getIdPropinsi(), $comparison); } elseif ($kota instanceof PropelObjectCollection) { return $this->useKotaQuery()->filterByPrimaryKeys($kota->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByKota() only accepts arguments of type Kota or PropelCollection'); } }
/** * Exclude object from result * * @param Kota $kota Object to remove from the list of results * * @return KotaQuery The current query, for fluid interface */ public function prune($kota = null) { if ($kota) { $this->addUsingAlias(KotaPeer::ID, $kota->getId(), Criteria::NOT_EQUAL); } return $this; }