/** * Save the object back to the database * * @author Jonathan Davis * @since 1.1 * * @return void **/ function save() { if (!empty($this->_xcols)) { $value = new stdClass(); foreach ((array) $this->_xcols as $col) { $value->{$col} = $this->{$col}; } $this->value = $value; } parent::save(); }
public function save() { $addons = $this->addons; // Save current addons model if (!empty($addons) && is_array($addons)) { $this->addons = 'yes'; } // convert property to usable flag parent::save(); if (!empty($addons) && is_array($addons)) { foreach ($addons as $Addon) { $Addon->parent = $this->id; $Addon->save(); } } $this->addons = $addons; // restore addons model }
/** * Saves updates or creates records for the defined object properties * * @author Jonathan Davis * @since 1.2 * * @return void **/ function save() { $this->value = array(); foreach ($this->_settings as $property) { if (!isset($this->{$property})) { continue; } $this->value[$property] = $this->{$property}; } parent::save(); }
public function save() { $new = false; if (empty($this->id)) { $new = true; } if (!empty($this->card)) { $this->card = PayCard::truncate($this->card); } parent::save(); }
/** * Adds the save_post event to Shopp custom post saves * * @author Jonathan Davis * @since 1.2 * * @return void **/ function save() { parent::save(); do_action('save_post', $this->id, get_post($this->id)); }
/** * Save the record to the database * * @author Jonathan Davis * @since 1.2 * * @return void **/ public function save() { if (empty($this->password)) { // Do not save empty password updates unset($this->password); } parent::save(); if (empty($this->info) || !is_array($this->info)) { return true; } foreach ((array) $this->info as $name => $value) { $Meta = new ShoppMetaObject(array('parent' => $this->id, 'context' => 'customer', 'type' => 'meta', 'name' => $name)); $Meta->parent = $this->id; $Meta->context = 'customer'; $Meta->type = 'meta'; $Meta->name = $name; $Meta->value = $value; $Meta->save(); } }
/** * Process content into an index and save it * * @author Jonathan Davis * @since 1.1 * * @param string $content The content to index * @return void **/ function save() { list($content, ) = func_get_args(); $content = apply_filters('shopp_index_content', $content, $this); if (empty($this->product) || empty($this->type) || empty($content)) { return false; } $factoring = Lookup::index_factors(); if (isset($factoring[$this->type])) { $this->factor = $factoring[$this->type]; } else { $this->factor = 1; } $this->terms = $content; parent::save(); }