public function save() { if (!$this->type_id) { $this->type_id = 11; } if (!$this->name) { $this->name = L('shop.empty_name'); } if (!$this->city_id && me()->id()) { $this->city_id = me()->city_id; } if (!($this->longitude + 0)) { $this->longitude = NULL; } if (!($this->latitude + 0)) { $this->latitude = NULL; } /*foreach ($this->links() as $link) { $link->shop_type=$this->type_id; $link->name=$this->name; $link->save(); }*/ $this->mdate = M('Date')->dbDateTime(); if (!$this->cdate) { $this->cdate = M('Date')->dbDateTime(); } return parent::save(); }
public function save() { if ($this->_saving) { $this->_saving = 0; return TRUE; } $this->_saving = 1; if (!$this->shop_type) { $this->shop_type = 11; } parent::save(); $shop = $this->shop(); if (!$shop->type_id || $shop->type_id == 11) { $shop->type_id = $this->shop_type; } if (!$shop->name || $shop->unnamed()) { $shop->name = $this->name; } if (!$shop->street || $shop->noStreet()) { $shop->street = $this->street; } if (!$shop->bld || $shop->noBld()) { $shop->bld = $this->bld; } $shop->save(); }
public function save() { if (!parent::save()) { return FALSE; } $this->updateQueueStatus(); return TRUE; }
public function save() { if (!$this->last_id) { $this->last_id = 0; } $this->cdate = M('Date')->dbDateTime(); parent::save(); }
public function save() { $this->mdate = M('Date')->dbDateTime(); if ($this->version == $this->_propInitial('version')) { $this->subversion++; } return parent::save(); }
/** * @see RM_Store_Object::save */ public function save() { $this->validator($this->_mapper->_getValidator($this->script_type)); parent::save(); if ($this->_map) { $this->_mapper->saveMap($this, $this->_map); } return TRUE; }
/** * Saves account (count data implements) * * @return bool */ public function save() { if (!$this->cdate) { $this->cdate = M('Date')->dbDateTime(); } $this->mdate = M('Date')->dbDateTime(); $this->_prepare(); return parent::save(); }
public function save() { if (!$this->cdate) { $this->cdate = M('Date')->dbDate(); } if (!$this->id()) { $this->status_id = REPORT_QUEUE_PENDING; } return parent::save(); }
/** * Enter description here... * * @return bool */ public function save() { if (!$this->is_visible) { $this->is_visible = 0; } if (!$this->ord) { $this->ord = 0; } return parent::save(); }
public function save() { if (!isset($this->_props['owner_id'])) { $this->_props['owner_id'] = -1; } if (!isset($this->_props['parent_id'])) { $this->_props['parent_id'] = 0; } return parent::save(); }
public function save() { if (!parent::save()) { return FALSE; } // var_dump($this->stack()); foreach ($this->stack() as $id => $object) { $this->_mapper->setDependency($this, $object); } return TRUE; }
/** * Description... * * @return void **/ public function save() { if (!$this->cdate) { $this->cdate = M('Date')->dbDateTime(); } if (!$this->moderated) { $this->moderated = 0; } $this->mdate = M('Date')->dbDateTime(); parent::save(); }
/** * Enter description here... * * @return bool */ public function save() { if (!$this->amount_date) { $this->amount_date = M('Date')->dbDate(); } if (M('Date')->time(M('Date')->dbDate($this->getAccount()->getUser()->setup_date)) > M('Date')->time($this->amount_date)) { return FALSE; } if (!$this->_existsInDb) { $this->cdate = M('Date')->dbDateTime(); } if (parent::save()) { $obAccount = $this->getAccount(); $obAccount->save(); } return TRUE; }
/** * Enter description here... * * @return unknown */ public function save() { $this->is_published = $this->is_published ? 1 : 0; $this->posted = M('Date')->dbDate($this->posted); $this->mdate = M('Date')->dbDateTime(); $this->user_id = me()->id(); $this->city_id += 0; if (!$this->city_id && !me()->isUserInGroup('federal-news')) { $this->city_id = me()->city_id; } if (($this->city_id != me()->city_id || !$this->city_id) && !me()->isUserInGroup('federal-news')) { $this->_permissionDenied(); } if ($this->city_id == me()->city_id && !me()->isUserInGroup('regional-news')) { $this->_permissionDenied(); } return parent::save(); }
/** * Saves restriction object * * @return void **/ public function save() { if (!$this->order_id) { $this->order_id = 0; } return parent::save(); }
/** * Saves this object * * @return bool **/ public function save() { $this->getResult()->clearRelatedResultSteps($this->getStep()); return parent::save(); }
/** * Saves this object * * @return bool **/ public function save() { $this->mdate = M('Date')->dbDateTime(); $this->getResult()->clearRelatedResultAnswers($this->getQuestion()); return parent::save(); }
/** * Saves this object * * @return bool **/ public function save() { if (!$this->_existsInDb()) { $this->id = mb_strtolower($this->id, mb_detect_encoding($this->id)); } return parent::save(); }
/** * Saves this object * * @return bool **/ public function save() { // нельзя редактировать, если объект в стоплисте if ($this->_propInitial('stoplist') == 1) { return FALSE; } $this->correctName(); return parent::save(); }
public function save() { $this->mdate = M('Date')->dbDateTime(); return parent::save(); }
/** * Saves leave. * * @return bool */ public function save() { $this->_mapper->setDaysByLeave($this); $data['mdate'] = M('Tools')->date()->dbDateTime(); return parent::save(); }
/** * Saves this object * * @return bool **/ public function save() { if ($this->_existsInDb) { $this->CoderID = me()->id(); $this->CodedDate = M('Tools')->date()->dbDateTime(); } elseif (!$this->CoderID) { $this->CoderID = 0; } $this->is_food = (int) $this->is_food; // validate barcode entities foreach ($this->_mapper->related_entities() as $entity_type => $field_name) { if (!(int) $this->{$field_name}) { $this->{$field_name} = M('Barcode')->getEmptyEntity($entity_type)->id(); } } // validate GPC entitites specified for this barcode foreach (M('Gpc')->entities() as $gpc_entity) { if ($this->{$gpc_entity . '_id'} && isNull($this->{'get' . ucfirst($gpc_entity)}())) { $this->{$gpc_entity . '_id'} = NULL; } } if (!($this->complete > 0)) { $this->complete = 0; } $this->_validateAttributes(); // save last state data for barcodes control report $dataInitial = $this->_propsInitial; if ($result = parent::save()) { $this->cleanFlavours(); if (isset($this->_props['CoderId'])) { $this->_addToBarcodeControl($dataInitial); } } return $result; }
public function save() { $this->corrected_name = trim($this->corrected_name); if (!$this->is_deleted) { $this->is_deleted = 0; } if (!$this->cdate) { $this->cdate = M('Date')->dbDateTime(); } if (!$this->status_id) { $this->status_id = 1; } $this->_setStatus(); if (isNull($obReceipt = $this->getVirtualReceipt())) { throw new RM_Base_Exception_BadUsage(__METHOD__ . ' : undefined receipt'); } $this->user_id = $obReceipt->user_id; $this->bdate = $obReceipt->bdate; if ($this->barcode_value != $this->_propsInitial['barcode_value']) { if (!isNull($obBarcode = M('Barcode')->loadBarcodeOrCreateFromGepir($this->barcode_value)) && $obBarcode->attribute_1) { $this->corrected_name = $obBarcode->attribute_1; } } if (parent::save()) { if (!$this->is_deleted) { $this->state()->save(); } $obReceipt->save(); } me()->setStatus(10, qw2('11')); }
/** * Saves this object * * @return bool **/ public function save() { if (!$this->_existsInDb()) { $this->id = mb_strtolower($this->id, mb_detect_encoding($this->id)); } if (!$this->order_id) { $this->order_id = 0; } if (!$this->can_finish) { $this->can_finish = 0; } return parent::save(); }
/** * Saves this object * * @return bool **/ public function save() { $this->_validateFields(); return parent::save(); }
/** * Enter description here... * * @return bool */ public function save() { if (!$this->_existsInDb()) { $this->cdate = M('Date')->dbDateTime(); } $this->mdate = M('Date')->dbDateTime(); $this->state = $this->_state()->getName(); foreach ($this->_items as $obOrderItem) { $obOrderItem->save(); } return parent::save(); }