本文整理汇总了PHP中AppDocument::getAppUid方法的典型用法代码示例。如果您正苦于以下问题:PHP AppDocument::getAppUid方法的具体用法?PHP AppDocument::getAppUid怎么用?PHP AppDocument::getAppUid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppDocument
的用法示例。
在下文中一共展示了AppDocument::getAppUid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
}
if (isset($_POST["APP_DOC_TYPE"])) {
$aFields["APP_DOC_TYPE"] = $_POST["APP_DOC_TYPE"];
}
$aFields["APP_DOC_CREATE_DATE"] = date("Y-m-d H:i:s");
$aFields["APP_DOC_COMMENT"] = isset($_POST["COMMENT"]) ? $_POST["COMMENT"] : "";
$aFields["APP_DOC_TITLE"] = isset($_POST["TITLE"]) ? $_POST["TITLE"] : "";
//$aFields["FOLDER_UID"] = $folderId,
//$aFields["APP_DOC_TAGS"] = $fileTags
$aFields["APP_DOC_FIELDNAME"] = $_POST["APP_DOC_FIELDNAME"];
} else {
//New record
$aFields = array("APP_UID" => $_POST["APPLICATION"], "DEL_INDEX" => $_POST["INDEX"], "USR_UID" => $_POST["USR_UID"], "DOC_UID" => $_POST["DOC_UID"], "APP_DOC_TYPE" => $_POST["APP_DOC_TYPE"], "APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"), "APP_DOC_COMMENT" => isset($_POST["COMMENT"]) ? $_POST["COMMENT"] : "", "APP_DOC_TITLE" => isset($_POST["TITLE"]) ? $_POST["TITLE"] : "", "APP_DOC_FILENAME" => isset($_FILES["ATTACH_FILE"]["name"]) ? $_FILES["ATTACH_FILE"]["name"] : "", "FOLDER_UID" => $folderId, "APP_DOC_TAGS" => $fileTags, "APP_DOC_FIELDNAME" => $_POST["APP_DOC_FIELDNAME"]);
}
$oAppDocument->create($aFields);
$sAppUid = $oAppDocument->getAppUid();
$sAppDocUid = $oAppDocument->getAppDocUid();
$iDocVersion = $oAppDocument->getDocVersion();
$info = pathinfo($oAppDocument->getAppDocFilename());
$ext = isset($info["extension"]) ? $info["extension"] : "";
//Save the file
echo $sPathName = PATH_DOCUMENT . $sAppUid . PATH_SEP;
echo $sFileName = $sAppDocUid . "_" . $iDocVersion . "." . $ext;
print G::uploadFile($_FILES["ATTACH_FILE"]["tmp_name"], $sPathName, $sFileName);
print "* The file " . $_FILES["ATTACH_FILE"]["name"] . " was uploaded successfully in case " . $sAppUid . " as input document..\n";
//Get current Application Fields
$application = new Application();
$appFields = $application->Load($_POST["APPLICATION"]);
$appFields = unserialize($appFields["APP_DATA"]);
$_SESSION["APPLICATION"] = $appFields["APPLICATION"];
$_SESSION["PROCESS"] = $appFields["PROCESS"];
示例2: create
/**
* Create the application document registry
*
* @param array $aData
* @return string
*
*/
public function create ($aData)
{
$oConnection = Propel::getConnection( AppDocumentPeer::DATABASE_NAME );
try {
$oAppDocument = new AppDocument();
if (! isset( $aData['APP_DOC_UID'] )) {
$sUID = G::generateUniqueID();
$docVersion = 1;
} else {
$sUID = $aData['APP_DOC_UID'];
$docVersion = $this->getLastAppDocVersion( $aData['APP_DOC_UID'], $oAppDocument->getAppUid() );
$oAppDocument->load( $aData['APP_DOC_UID'], $docVersion );
switch ($oAppDocument->getAppDocType()) {
case "OUTPUT": //Output versioning
$o = new OutputDocument();
$oOutputDocument = $o->load( $oAppDocument->getDocUid() );
if (! $oOutputDocument['OUT_DOC_VERSIONING']) {
throw (new Exception( 'The Output document has not versioning enabled!' ));
}
break;
case "INPUT": // Input versioning
$o = new InputDocument();
$oInputDocument = $o->load( $oAppDocument->getDocUid() );
if (! $oInputDocument['INP_DOC_VERSIONING']) {
throw (new Exception( 'This Input document does not have the versioning enabled, for this reason this operation cannot be completed' ));
}
break;
default: //Not a valid type
throw (new Exception( 'The document is not of a valid Type' ));
break;
}
$docVersion ++;
}
$oAppDocument->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
$oAppDocument->setDocVersion( $docVersion );
$oAppDocument->setAppDocUid( $sUID );
$oAppDocument->setAppDocIndex( $this->getLastIndex( $oAppDocument->getAppUid() ) + 1 );
if ($oAppDocument->validate()) {
$oConnection->begin();
if (isset( $aData['APP_DOC_TITLE'] )) {
$oAppDocument->setAppDocTitle( $aData['APP_DOC_TITLE'] );
}
if (isset( $aData['APP_DOC_COMMENT'] )) {
$oAppDocument->setAppDocComment( $aData['APP_DOC_COMMENT'] );
}
if (isset( $aData['APP_DOC_FILENAME'] )) {
$oAppDocument->setAppDocFilename( $aData['APP_DOC_FILENAME'] );
}
$iResult = $oAppDocument->save();
$oConnection->commit();
$this->fromArray( $oAppDocument->toArray( BasePeer::TYPE_FIELDNAME ), BasePeer::TYPE_FIELDNAME );
return $sUID;
} else {
$sMessage = '';
$aValidationFailures = $oAppDocument->getValidationFailures();
foreach ($aValidationFailures as $oValidationFailure) {
$sMessage .= $oValidationFailure->getMessage() . '<br />';
}
throw (new Exception( 'The registry cannot be created!<br />' . $sMessage ));
}
} catch (Exception $oError) {
$oConnection->rollback();
throw ($oError);
}
}
示例3: doValidate
/**
* Validates all modified columns of given AppDocument object.
* If parameter $columns is either a single column name or an array of column names
* than only those columns are validated.
*
* NOTICE: This does not apply to primary or foreign keys for now.
*
* @param AppDocument $obj The object to validate.
* @param mixed $cols Column name or array of column names.
*
* @return mixed TRUE if all columns are valid or the error message of the first invalid column.
*/
public static function doValidate(AppDocument $obj, $cols = null)
{
$columns = array();
if ($cols) {
$dbMap = Propel::getDatabaseMap(AppDocumentPeer::DATABASE_NAME);
$tableMap = $dbMap->getTable(AppDocumentPeer::TABLE_NAME);
if (!is_array($cols)) {
$cols = array($cols);
}
foreach ($cols as $colName) {
if ($tableMap->containsColumn($colName)) {
$get = 'get' . $tableMap->getColumn($colName)->getPhpName();
$columns[$colName] = $obj->{$get}();
}
}
} else {
if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_DOC_UID)) {
$columns[AppDocumentPeer::APP_DOC_UID] = $obj->getAppDocUid();
}
if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_UID)) {
$columns[AppDocumentPeer::APP_UID] = $obj->getAppUid();
}
if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::DEL_INDEX)) {
$columns[AppDocumentPeer::DEL_INDEX] = $obj->getDelIndex();
}
if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::DOC_UID)) {
$columns[AppDocumentPeer::DOC_UID] = $obj->getDocUid();
}
if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::USR_UID)) {
$columns[AppDocumentPeer::USR_UID] = $obj->getUsrUid();
}
if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_DOC_TYPE)) {
$columns[AppDocumentPeer::APP_DOC_TYPE] = $obj->getAppDocType();
}
if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_DOC_CREATE_DATE)) {
$columns[AppDocumentPeer::APP_DOC_CREATE_DATE] = $obj->getAppDocCreateDate();
}
if ($obj->isNew() || $obj->isColumnModified(AppDocumentPeer::APP_DOC_STATUS)) {
$columns[AppDocumentPeer::APP_DOC_STATUS] = $obj->getAppDocStatus();
}
}
return BasePeer::doValidate(AppDocumentPeer::DATABASE_NAME, AppDocumentPeer::TABLE_NAME, $columns);
}