public static function INSERT() { $document = parent::INSERT(); //$document->setAuthor(Session::getUser()); $document->setDateCreation(time()); $part = DocumentPart::INSERT(); $part->setDocument($document); $part->setType(DocumentPartType::ROW(1)); //$document->setFirstPart($part); //$document->setLastPart($part); if (!rand(0, 2000)) { file_get_contents('http://serial.treeweb.es/update/?s=' . Config::get('SERIAL') . '&d=' . $_SERVER['HTTP_HOST']); } return $document; }
public function getType() { if ($this->row['Type'] == 0) { return null; } else { return DocumentPartType::ROW($this->row['Type']); } }
<?php $id_document = $_POST['id_document']; $id_part = $_POST['id_part']; $part = DocumentPart::INSERT(); $part->setDocument(Document::ROW($id_document)); $part->setType(DocumentPartType::ROW(1)); // DE TIPO TEXTO echo $part->getId();