public function addColItem(ColItem $l) { $this->collColItems[] = $l; $l->setCatalog($this); }
public function addColItem(ColItem $l) { $this->collColItems[] = $l; $l->setColStatus($this); }
public function addColItem(ColItem $l) { $this->collColItems[] = $l; $l->setColCondition($this); }
public function addColItem(ColItem $l) { $this->collColItems[] = $l; $l->setMember($this); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); $col_item_param = $this->getRequestParameter('col_item'); #if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { # $col_item = new ColItem(); #} #else { #$col_item = ColItemPeer::retrieveByPk($this->getRequestParameter('id')); #$this->forward404Unless($col_item); #} #$catalog = CatalogPeer::retrieveByPk($this->getRequestParameter('id')); #$this->forward404Unless($catalog); $col_item = new ColItem(); $col_item->setCatalogId($this->getRequestParameter('id')); $col_item->setColStatusId($col_item_param['COL_STATUS_ID']); $col_item->setColConditionId($col_item_param['col_item_ID']); $col_item->setCallNo($this->getRequestParameter('call_no')); $col_item->setIndexNo($this->getRequestParameter('index_no')); $col_item->setColLocationId($col_item_param['COL_LOCATION_ID']); $col_item->setColSourceId($col_item_param['COL_SOURCE_ID']); $col_item->setColSourceDesc($col_item_param['COL_SOURCE_DESC']); $col_item->setYearAdded($col_item_param['YEAR_ADDED']); $col_item->save(); return $this->redirect('col_item/list?catalog_id=' . $this->getRequestParameter('id')); }
public function addCopies($action) { $copies = $action->getRequestParameter('copies'); if (is_numeric($copies)) { for ($i = 1; $i < $copies + 1; $i++) { $c = new Criteria(); $c->add(ColItemPeer::CALL_NO, $this->getCode() . '-' . $i); $col_item = ColItemPeer::doSelectOne($c); if ($col_item) { ++$copies; continue; } else { $ci = new ColItem(); $ci->setCatalog($this); $ci->setCallNo($this->getCode()); $ci->setIndexNo($this->getCode() . '-' . $i); $ci->setColConditionId(1); $ci->setColStatusId(1); $ci->save(); } } } $this->save(); }