Ejemplo n.º 1
0
 public function duplicate()
 {
     self::$object = "ElementField";
     self::$table = "pcms_element_field";
     return parent::duplicate();
 }
Ejemplo n.º 2
0
 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;
 }