本文整理汇总了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;
}