/** * Create new record * * @param array $all_fields * */ public function doCreate() { global $ilDB; if (!ilDataCollectionTable::_tableExists($this->getTableId())) { throw new ilException("The field does not have a related table!"); } // Record erzeugen $id = $ilDB->nextId("il_dcl_record"); $this->setId($id); $query = "INSERT INTO il_dcl_record (\n\t\t\tid,\n\t\t\ttable_id,\n\t\t\tcreate_date,\n\t\t\tLast_update,\n\t\t\towner,\n\t\t\tlast_edit_by\n\t\t\t) VALUES (" . $ilDB->quote($this->getId(), "integer") . "," . $ilDB->quote($this->getTableId(), "integer") . "," . $ilDB->quote($this->getCreateDate(), "timestamp") . "," . $ilDB->quote($this->getLastUpdate(), "timestamp") . "," . $ilDB->quote($this->getOwner(), "integer") . "," . $ilDB->quote($this->getLastEditBy(), "integer") . "\n\t\t\t)"; $ilDB->manipulate($query); include_once "./Modules/DataCollection/classes/class.ilObjDataCollection.php"; }
/** * Create new field */ public function doCreate() { global $ilDB; $this->getLocked() == NULL ? $this->setLocked(false) : true; if (!ilDataCollectionTable::_tableExists($this->getTableId())) { throw new ilException("The field does not have a related table!"); } $id = $ilDB->nextId("il_dcl_field"); $this->setId($id); $query = "INSERT INTO il_dcl_field (" . "id" . ", table_id" . ", datatype_id" . ", title" . ", description" . ", required" . ", is_unique" . ", is_locked" . " ) VALUES (" . $ilDB->quote($this->getId(), "integer") . "," . $ilDB->quote($this->getTableId(), "integer") . "," . $ilDB->quote($this->getDatatypeId(), "integer") . "," . $ilDB->quote($this->getTitle(), "text") . "," . $ilDB->quote($this->getDescription(), "text") . "," . $ilDB->quote($this->getRequired(), "integer") . "," . $ilDB->quote($this->isUnique(), "integer") . "," . $ilDB->quote($this->getLocked() ? 1 : 0, "integer") . ")"; $ilDB->manipulate($query); $this->updateVisibility(); $this->updateFilterability(); $this->updateEditability(); }