致命错误:在数组上调用成员函数create()

时间:2015-08-09 21:42:32

标签: php html post schema truevault

我正在使用Truevault API并为我的Vault创建架构,并最终创建我存储在其中的文档。

这是我的代码:

$trueVault = new TrueVault(array(
    "apiKey" => TRUEVAULT_API_KEY,
    "accountId" => TRUEVAULT_ACCOUNT_ID
));

$schemas = $trueVault->schemas(TRUEVAULT_VAULT_ID);
$documents = $trueVault->documents(TRUEVAULT_VAULT_ID);
$blobs = $trueVault->blobs(TRUEVAULT_VAULT_ID); 
var_dump($trueVault->findAllVaults());

$schemas = $schemas->findAll();
var_dump($schemas);

$schemaId = array_search("Referral Form", $schemas);
var_dump($schemaId);
if (!$schemaId) {
    //THIS LINE IS GETTING THE ERROR: 
$schema = $schemas->create(array("name" => "Referral Form", "fields" => array(array("name" => "name", "index" => true, "type" => "string"))));

    $schemaId = $schema["id"];
    echo($schemaId);
}

当我在服务器上运行代码时,出现以下错误:

  

致命错误:在......

中的数组上调用成员函数create()

0 个答案:

没有答案