Пример #1
0
 public static function setObjectStatusAction(DatabaseObject &$object, $action)
 {
     if ($action == 'publish') {
         $object->sendLive();
         $object->save();
     } else {
         if ($action == 'unpublish') {
             $object->sendBackToDraft();
             //echo "object sent back to draft";
             $object->save();
         } else {
             if ($action == 'delete') {
                 $object->delete();
             }
         }
     }
 }
Пример #2
0
 public function save()
 {
     //We have added the name attribute after the fact, and here, we are cleaning it up
     unset($this->attributes["shortName"]);
     unset($this->attributesNames["shortName"]);
     unset($this->attributes["subjectText"]);
     unset($this->attributesNames["subjectText"]);
     parent::save();
 }
Пример #3
0
	function save() {
		$addons = $this->addons;					// Save current addons model
		if (!empty($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
	}
Пример #4
0
	function save () {
		parent::save();

		if (empty($this->info) || !is_array($this->info)) return true;
		foreach ((array)$this->info as $name => $value) {
			$Meta = new MetaObject(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();
		}
	}
Пример #5
0
	/**
	 * Process content into an index and save it
	 *	 
	 * @since 1.1
	 *
	 * @return void Description...
	 **/
	function save ($content) {
		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 = apply_filters('ecart_index_content',$content);

		parent::save();
	}