public function duplicate() { self::$object = "ElementField"; self::$table = "pcms_element_field"; return parent::duplicate(); }
public function duplicate() { if ($this->id > 0) { //*** Duplicate the field. $objNewField = parent::duplicate(); //*** Duplicate the values for this field. $objContentLangs = ContentLanguage::select(); foreach ($objContentLangs as $objContentLanguage) { $objValue = $this->getValueObject($objContentLanguage->getId()); if (is_object($objValue)) { $objNewValue = $objValue->duplicate(); if (is_object($objNewValue)) { $objNewValue->setFieldId($objNewField->getId()); $objNewValue->save(); } } } return $objNewField; } return NULL; }