本文整理匯總了PHP中Stack::_sql_type_verify方法的典型用法代碼示例。如果您正苦於以下問題:PHP Stack::_sql_type_verify方法的具體用法?PHP Stack::_sql_type_verify怎麽用?PHP Stack::_sql_type_verify使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Stack
的用法示例。
在下文中一共展示了Stack::_sql_type_verify方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: stack_save_card
public function stack_save_card($card)
{
$this->_check_growability();
// ** TODO ** some card properties, such as Cant_Delete, Marked, Dont_search, script
// might only be available in certain user-levels? may want to check later during a security audit
Util::keys_required($card, array('id'));
$card_id = intval($card['id']);
$this->file_db->beginTransaction();
$sql = Stack::_sql_optional_update('card', $card, array('name:str255', 'cant_delete:bool', 'dont_search:bool', 'marked:bool', 'script:text16', 'art:image', 'art_hidden:bool'));
if ($sql !== null) {
$stmt = $this->file_db->prepare($sql['sql'] . ' WHERE id=?');
$sql['params'][] = $card_id;
$stmt->execute($sql['params']);
}
if (array_key_exists('objects', $card)) {
$this->_save_layer_parts(-$card_id, $card['objects']);
}
if (array_key_exists('content', $card)) {
if (!is_array($card['content'])) {
CinsImpError::malformed('layer content must be an array');
}
$this->file_db->exec('DELETE FROM card_data WHERE card_id=' . $card_id);
$stmt = $this->file_db->prepare('INSERT INTO card_data (card_id,bkgnd_object_id,content) VALUES (?,?,?)');
foreach ($card['content'] as $content_def) {
if (count($content_def) != 2) {
CinsImpError::malformed('card content form is not [id,content]');
}
$content = $content_def[1];
$content_def[1] = null;
Stack::_sql_type_verify($content, 'text20');
$def = array($card_id, intval($content_def[0]), $content);
$stmt->execute($def);
}
}
$this->file_db->commit();
return $card_id;
}