本文整理汇总了PHP中FileMaker::isError方法的典型用法代码示例。如果您正苦于以下问题:PHP FileMaker::isError方法的具体用法?PHP FileMaker::isError怎么用?PHP FileMaker::isError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileMaker
的用法示例。
在下文中一共展示了FileMaker::isError方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fmEvaluate
function fmEvaluate($connection, $expression)
{
// If the specified database connection isn't valid...
if (!isset($connection)) {
$error_message = 'fmEvaluate failed. It looks like the database connection that was specified is invalid.';
die($error_message);
}
// Setup the Find All command against the FMWebFrame Interface layout.
$fm_request = $connection->newFindAllCommand('FMWebFrame');
// Create the "newPerformScriptCommand" request.
$fm_request = $connection->newPerformScriptCommand('FMWebFrame', 'FMWebFrame', "evaluate\n" . $expression);
// Execute the request.
$fm_result = $fm_request->execute();
// If there was an error...
if (FileMaker::isError($fm_result)) {
$error_message = 'fmExecuteSQL failed with error ' . $fm_result->code . '.';
die($error_message);
} else {
// Get the result.
$result_records = $fm_result->getRecords();
$result_record = $result_records[0];
}
// Convert the result into an associative array.
$result_array = array();
$result_array['Expression'] = $expression;
$result_array['Result'] = $result_record->getField('Result_Data');
return $result_array;
}
示例2: foreach
function &execute()
{
$V21ffce5b = $this->_getCommandParams();
$this->_setSortParams($V21ffce5b);
$this->_setRangeParams($V21ffce5b);
$this->_setRelatedSetsFilters($V21ffce5b);
if (count($this->_findCriteria) || $this->_recordId) {
$V21ffce5b['-find'] = true;
} else {
$V21ffce5b['-findall'] = true;
}
if ($this->_recordId) {
$V21ffce5b['-recid'] = $this->_recordId;
}
if ($this->Vf951bdce) {
$V21ffce5b['-lop'] = $this->Vf951bdce;
}
foreach ($this->_findCriteria as $Vd1148ee8 => $Ve9de89b0) {
$V21ffce5b[$Vd1148ee8] = $Ve9de89b0;
}
$V0f635d0e = $this->_fm->_execute($V21ffce5b);
if (FileMaker::isError($V0f635d0e)) {
return $V0f635d0e;
}
return $this->_getResult($V0f635d0e);
}
示例3: pushDocumentDataToFM
function pushDocumentDataToFM($original, $temp, $pkId)
{
global $fmOrderDB, $log;
/* TODO need to investigate why getRelatedRecords() Stopped Working */
$metaFind = $fmOrderDB->newFindCommand('[WEB] Project Meta Fields');
$metaFind->addFindCriterion('__pk_ID', '==' . $pkId);
$metaResults = $metaFind->execute();
if (FileMaker::isError($metaResults)) {
$errorTitle = "FileMaker Error";
$log->error("pushDocumentDataToFM - Failure to open " . $metaResults . " " . $metaResults->getMessage() . " " . $metaResults->getCode());
processError($metaResults->getMessage(), $metaResults->getErrorString(), "deliverableService.php", $pkId, $errorTitle);
exit;
}
$metaRelatedRecords = $metaResults->getRecords();
$metaRecord = $metaRelatedRecords[0];
$metaRecord->setField('Upload_Filename_Original_t', $original);
$metaRecord->setField("Upload_Filename_Temp_t", $temp);
$result = $metaRecord->commit();
if (FileMaker::isError($result)) {
$errorTitle = "FileMaker Error";
$log->error("pushDocumentDataToFM - Failure to open " . $metaResults . " " . $result->getMessage() . " " . $result->getCode());
processError($result->getMessage(), $result->getErrorString(), "deliverableService.php", $pkId, $errorTitle);
exit;
}
}
示例4: handleDBError
function handleDBError($request_object, $s_system_status = '')
{
if (FileMaker::isError($request_object)) {
$request_error_code = $request_object->getCode();
if ($request_error_code != 401) {
// Errors:
// - The requested URL returned error: 404
// - Possible reasons: Access via PHP not enabled. Instant Web Publishing not enabled
// - The requested URL returned error: 401
// - Invalid Username and password
//
//echo date("Y-m-d")." Error: " . $request_object->getCode()." - ".$request_object->getMessage() . "\n";
redirect('/oops/' . $request_error_code);
//exit;
} else {
return $request_error_code;
}
} elseif ($s_system_status != '') {
if (strtolower($s_system_status) != 'live') {
// System Offline
unset($_SESSION["user"]);
redirect('/maintenance.php?status=offline');
exit;
}
}
}
示例5: isError
/**
* Checks whether there is an error in the resource given.
*
* @author RichardC
* @since 1.0
*
* @version 1.6
*
* @param obj $request_object
*
* @return int
*/
public static function isError($request_object)
{
if (is_array($request_object) && preg_grep('/^([^*)]*)error([^*)]*)$/', array_keys($request_object))) {
foreach ($request_object as $key => $val) {
return (int) $val;
}
}
return FileMaker::isError($request_object) ? (int) $request_object->getCode() : 0;
}
示例6: execute
function execute()
{
$V21ffce5b = $this->_getCommandParams();
$V21ffce5b['-findany'] = true;
$V0f635d0e = $this->_fm->_execute($V21ffce5b);
if (FileMaker::isError($V0f635d0e)) {
return $V0f635d0e;
}
return $this->_getResult($V0f635d0e);
}
示例7: execute
function execute()
{
$commandParams = $this->_getCommandParams();
$commandParams['-findany'] = true;
$result = $this->_fm->_execute($commandParams);
if (FileMaker::isError($result)) {
return $result;
}
return $this->_getResult($result);
}
示例8: fmDisplaySearchResults
function fmDisplaySearchResults($result, $whetherToPaginate)
{
global $skip, $paginate_number, $max, $page, $querystring;
// If an error is found, return a message and exit.
if (FileMaker::isError($result)) {
echo "Error: " . $result->getMessage() . "<br>";
//exit;
} else {
// Get records from found set
$records = $result->getRecords();
$found = $result->getFoundSetCount();
//Setup sort by type
$fileType = $records[0]->getField('Source_Type');
if ($fileType != "Video") {
$fileType = "Images";
}
echo '<div class="recordSeparator">' . $fileType . '</div>';
foreach ($records as $record) {
//searchResultDisplay($record,$fileType);
if ($record->getField('Source_Type') == "Video") {
displayVideoPreview($record);
} else {
if ($fileType != "Images") {
echo '<p> </p><div class="recordSeparator">Images</div>';
}
displayImgPreview($record);
$fileType = "Images";
}
}
if ($whetherToPaginate) {
// adds pagination if specified. Disabled for "recent additions" mode.
?>
<div style="clear: both; padding-top: 20px; text-align: right;"><!--pagination div-->
<?php
//pagination
$displayed = count($records);
$pagenum = ceil($skip / $max + 1);
$pagetotal = ceil($found / $max);
if ($skip + $max > $found) {
$next = $skip;
}
echo "Displaying <b>{$displayed}</b> of <b>{$found}</b> results<br /><br />";
paginate($querystring, $page, $pagetotal);
?>
</div>
<?php
}
}
}
示例9: fmSearchResults
function fmSearchResults($searchArray, $searchLayout, $sortArray, $page)
{
// Grabs variables from outside the function
global $fm, $max, $querystring, $fmDefaultSortArray;
// Uses maximum and URL to tell page how many to skip.
$skip = ($page - 1) * $max;
// Create FileMaker_Command_CompoundFind object on layout to search
$compoundFind =& $fm->newCompoundFindCommand($searchLayout);
$compoundFindNum = 0;
$findreq =& $fm->newFindRequest($searchLayout);
// Create find requests on layout
foreach ($searchArray as $searchName => $searchCriteria) {
// adds find criteria
if (strpos($searchName, 'EXACT_') !== false) {
//If given keywords with "EXACT_" prefix, searches for exact match in field
$searchNameExact = str_replace("EXACT_", "", $searchName);
$findreq->addFindCriterion($searchNameExact, "=={$searchCriteria}");
} elseif ($searchName == "Work_Date_Begin") {
$findreq->addFindCriterion($searchName, ">{$searchCriteria}");
} elseif ($searchName == "page") {
} else {
$findreq->addFindCriterion($searchName, $searchCriteria);
}
$compoundFind->add($compoundFindNum, $findreq);
}
// Set Range
$compoundFind->setRange($skip, $max);
// Set sort order
$sorti = 1;
foreach ($sortArray as $sortName => $sortCriteria) {
if ($sortCriteria == "descend") {
$compoundFind->addSortRule($sortName, $sorti, FILEMAKER_SORT_DESCEND);
} else {
$compoundFind->addSortRule($sortName, $sorti, FILEMAKER_SORT_ASCEND);
}
$sorti++;
}
$defaultSortOrder = $fmDefaultSortArray[$searchLayout];
$compoundFind->addSortRule($defaultSortOrder, $sorti, FILEMAKER_SORT_ASCEND);
// Execute compound find command
$result = $compoundFind->execute();
if (FileMaker::isError($result)) {
echo "Error: " . $result->getMessage() . "<br>";
return null;
//exit;
} else {
$records = $result->getRecords();
return $records;
}
}
示例10: FileMaker_Error
function &execute()
{
if (empty($this->_recordId)) {
$Vcb5e100e = new FileMaker_Error($this->_fm, 'Delete commands require a record id.');
return $Vcb5e100e;
}
$V21ffce5b = $this->_getCommandParams();
$V21ffce5b['-delete'] = true;
$V21ffce5b['-recid'] = $this->_recordId;
$V0f635d0e = $this->_fm->_execute($V21ffce5b);
if (FileMaker::isError($V0f635d0e)) {
return $V0f635d0e;
}
return $this->_getResult($V0f635d0e);
}
示例11: execute
function execute()
{
$V090cbceb = null;
$V8ac10dab = 0;
$V31c3c8cf = 0;
$V40677621 = 1;
$Ve2942a04 = 1;
$V21ffce5b = $this->_getCommandParams();
$this->_setSortParams($V21ffce5b);
$this->_setRangeParams($V21ffce5b);
$this->_setRelatedSetsFilters($V21ffce5b);
ksort($this->Vad2bfd5a);
$V31c3c8cf = count($this->Vad2bfd5a);
foreach ($this->Vad2bfd5a as $V70a17ffa => $V9a7aa128) {
$V15c46c6e = $V9a7aa128->_impl->_findCriteria;
$V8ac10dab = count($V15c46c6e);
$V090cbceb = $V090cbceb . '(';
$V4111477f = 0;
foreach ($V15c46c6e as $Vd1148ee8 => $Ve9de89b0) {
$V21ffce5b['-q' . $Ve2942a04] = $Vd1148ee8;
$V21ffce5b['-q' . $Ve2942a04 . '.' . "value"] = $Ve9de89b0;
$V090cbceb = $V090cbceb . 'q' . $Ve2942a04;
$Ve2942a04++;
$V4111477f++;
if ($V4111477f < $V8ac10dab) {
$V090cbceb = $V090cbceb . ',';
}
}
$V090cbceb = $V090cbceb . ")";
$V40677621++;
if ($V40677621 <= $V31c3c8cf) {
$V4b22ce92 = $this->Vad2bfd5a[$V40677621];
if ($V4b22ce92->_impl->_omit == true) {
$V090cbceb = $V090cbceb . ';!';
} else {
$V090cbceb = $V090cbceb . ';';
}
}
}
$V21ffce5b['-query'] = $V090cbceb;
$V21ffce5b['-findquery'] = true;
$V0f635d0e = $this->_fm->_execute($V21ffce5b);
if (FileMaker::isError($V0f635d0e)) {
return $V0f635d0e;
}
return $this->_getResult($V0f635d0e);
}
示例12: FX_Fuzzy_Debugger
function FX_Fuzzy_Debugger(&$fmConnection, &$dataSet = '')
{
if ((bool) (is_object($fmConnection) && (strtolower(get_class($fmConnection)) == 'filemaker' || is_subclass_of($fmConnection, 'filemaker')))) {
require_once 'FileMaker.php';
$this->connectionType = FILEMAKER_API_CONNECTION;
$this->currentConnection = clone $fmConnection;
$this->currentDataSet = $dataSet;
if (FileMaker::isError($dataSet)) {
if (!isset($dataSet->code) || strlen(trim($dataSet->code)) < 1) {
$currentErrorMessage = "<p>A connection or XML error occured during your FileMaker query.<br />\n";
$currentErrorMessage .= "You may be able to get additional information by performing the same query using FX.php,<br />\n";
$currentErrorMessage .= "combined with a DEBUG constant and php's print_r() function.<br />\n";
$currentErrorMessage .= "Also, check your <strong>FileMaker Server Advanced configuration</strong>, and verify the <strong>server address</strong> used.</p>\n";
return $currentErrorMessage;
} else {
$this->currentErrorCode = $dataSet->code;
}
} else {
$this->currentErrorCode = 0;
}
$this->currentDatabase = $this->currentConnection->getProperty('database');
$this->currentLayout = '';
} elseif ((bool) (is_object($fmConnection) && (strtolower(get_class($fmConnection)) == 'fx' || is_subclass_of($fmConnection, 'fx')))) {
require_once 'FX.php';
$this->connectionType = FX_CONNECTION;
$this->currentConnection = clone $fmConnection;
if (is_array($dataSet) && isset($dataSet['errorCode'])) {
$this->currentErrorCode = $dataSet['errorCode'];
} else {
$this->currentErrorCode = $fmConnection->lastErrorCode;
}
$this->currentDatabase = $this->currentConnection->database;
$this->currentLayout = $this->currentConnection->layout;
foreach ($this->currentConnection->lastQueryParams as $tempParam) {
if (substr($tempParam['name'], 0, 1) != '-') {
// as long as the current field name doesn't begin with a '-' (FM reserved), add it to the list of fields
$this->currentFieldsArray[] = $tempParam['name'];
}
}
} else {
$currentErrorMessage = "<p>The FX Fuzzy Debugger does not support the type of connection that was passed in.<br />\n";
$currentErrorMessage .= "Double check that the first parameter is either an FX object or a FileMaker object.</p>\n";
$this->fuzzyOut = $currentErrorMessage;
return;
}
$this->fuzzyOut = $this->ProcessErrorCode();
}
示例13: getRespondentRecordFromRespondentID
/**
* Die Fkt. führt eine Suche im Layout 'Respondent' mit dem über $respondent_id
* übergeb. Wert durch. Wenn vorh., wird 1. entspr. Datens. zurückg., sonst null.
*/
function getRespondentRecordFromRespondentID($respondent_id)
{
global $fm;
//Layout angeben
$find = $fm->newFindCommand('Respondent');
//Geben Sie das Feld und den Wert für den Abgleich an. In diesem Fall ist 'Respondent ID' das Feld
// und $respondent_id der Wert.
$find->addFindCriterion('Respondent ID', $respondent_id);
//Suche durchführen
$results = $find->execute();
//Auf Fehler überprüfen
if (!FileMaker::isError($results)) {
//Keine Fehler, erstes entsprechendes Ergebnis zurückgeben
$records = $results->getRecords();
return $records[0];
} else {
//Fehler aufgetreten, null zurückgeben (d. h. keine Datensätze gefunden)
return null;
}
}
示例14: getRespondentRecordFromRespondentID
/**
* Den här funktionen utför en sökning i layouten 'Respondent' med hjälp av det värde som
* skickas via $respondent_id. Om det hittas, returneras den första matchande posten. Annars returneras noll.
*/
function getRespondentRecordFromRespondentID($respondent_id)
{
global $fm;
//Ange layout
$find = $fm->newFindCommand('Respondent');
//Ange fält och värde för matchning. I det här fallet är fältet 'Respondent ID'
// och värdet är $respondent_id.
$find->addFindCriterion('Respondent ID', $respondent_id);
//Utför sökningen
$results = $find->execute();
//Felkontroll
if (!FileMaker::isError($results)) {
//Inga fel, returnera första matchande resultat.
$records = $results->getRecords();
return $records[0];
} else {
//Det fanns fel, returnera noll (dvs inga matchningar hittades)
return null;
}
}
示例15: getRespondentRecordFromRespondentID
/**
* La fonction effectue une recherche sur le modèle 'Respondent' avec valeur récup.
* via $respondent_id. Si des enregistr. correspondent, le 1er s'affiche. Dans le cas contraire, rien ne s'affiche.
*/
function getRespondentRecordFromRespondentID($respondent_id)
{
global $fm;
//Spécifiez le modèle
$find = $fm->newFindCommand('Respondent');
//Indiquez la rubrique et la valeur à rechercher. Dans ce cas, 'Respondent ID' correspond à la rubrique
// et $respondent_id représente la valeur.
$find->addFindCriterion('Respondent ID', $respondent_id);
//Exécutez la recherche
$results = $find->execute();
//Vérifiez les erreurs
if (!FileMaker::isError($results)) {
//S'il n'y a pas d'erreur, affichez le premier résultat correspondant
$records = $results->getRecords();
return $records[0];
} else {
//En cas d'erreur, n'affichez aucun résultat (aucune valeur trouvée)
return null;
}
}