Esempio n. 1
0
 /**
  * @param  Webservice_Data $wsDocument
  * @param  Element_Interface $element
  * @return int
  */
 protected function create($wsDocument, $element)
 {
     $wsDocument->reverseMap($element);
     $element->setId(null);
     $element->setCreationDate(time());
     $this->setModificationParams($element, true);
     $key = $element->getKey();
     if (empty($key)) {
         throw new Exception("Cannot create element without key");
     }
     $element->save();
     return $element->getId();
 }