Save Meta Data of a Object Content Type
public static saveMetaValue ( type $key, type $value, type $object, type $create = true ) | ||
$key | type | |
$value | type | |
$object | type | |
$create | type |
protected function afterSave() { parent::afterSave(); if ($this->isNewRecord) { Object::saveMetaValue('price', $this->price, $this, true); } else { Object::saveMetaValue('price', $this->price, $this, false); } }
protected function afterSave() { parent::afterSave(); if ($this->isNewRecord) { Object::saveMetaValue('start_date', $this->start_date, $this, true); Object::saveMetaValue('end_date', $this->end_date, $this, true); } else { Object::saveMetaValue('start_date', $this->start_date, $this, false); Object::saveMetaValue('end_date', $this->end_date, $this, false); } }