/** * Get the associated ItemBase object * * @param PropelPDO Optional Connection object. * @return ItemBase The associated ItemBase object. * @throws PropelException */ public function getItemBase(PropelPDO $con = null) { if ($this->aItemBase === null && $this->id_item_base !== null) { $c = new Criteria(ItemBasePeer::DATABASE_NAME); $c->add(ItemBasePeer::ID_ITEM_BASE, $this->id_item_base); $this->aItemBase = ItemBasePeer::doSelectOne($c, $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->aItemBase->addItems($this); */ } return $this->aItemBase; }
protected function getItemOr404($id_item = 'id_item_base') { if (!$this->getRequestParameter($id_item)) { $this->forward404(); } else { $c = $this->getCriterio(); $c->addAnd(ItemBasePeer::ID_ITEM_BASE, $this->getRequestParameter($id_item)); $item = ItemBasePeer::doSelectOne($c); $this->forward404Unless($item); } return $item; }